[−][src]Struct gdnative::api::Camera
core class Camera
inherits Spatial
(unsafe).
Official documentation
See the documentation of this class in the Godot engine's official documentation.
Memory management
Non reference counted objects such as the ones of this type are usually owned by the engine.
Camera
is a reference-only type. Persistent references can
only exist in the unsafe Ref<Camera>
form.
In the cases where Rust code owns an object of this type, for example if the object was just
created on the Rust side and not passed to the engine yet, ownership should be either given
to the engine or the object must be manually destroyed using Ptr::free
, or Ptr::queue_free
if it is a Node
.
Class hierarchy
Camera inherits methods from:
Safety
All types in the Godot API have "interior mutability" in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Implementations
impl Camera
[src]
Constants
pub const DOPPLER_TRACKING_DISABLED: i64
[src]
pub const DOPPLER_TRACKING_IDLE_STEP: i64
[src]
pub const DOPPLER_TRACKING_PHYSICS_STEP: i64
[src]
pub const KEEP_HEIGHT: i64
[src]
pub const KEEP_WIDTH: i64
[src]
pub const PROJECTION_FRUSTUM: i64
[src]
pub const PROJECTION_ORTHOGONAL: i64
[src]
pub const PROJECTION_PERSPECTIVE: i64
[src]
impl Camera
[src]
pub fn new() -> Ref<Camera, Unique>
[src]
Creates a new instance of this object.
Because this type is not reference counted, the lifetime of the returned object is not automatically managed.
Immediately after creation, the object is owned by the caller, and can be
passed to the engine (in which case the engine will be responsible for
destroying the object) or destroyed manually using Ptr::free
, or preferably
Ptr::queue_free
if it is a Node
.
pub fn clear_current(&self, enable_next: bool)
[src]
pub fn get_camera_rid(&self) -> Rid
[src]
pub fn get_camera_transform(&self) -> Transform
[src]
pub fn cull_mask(&self) -> i64
[src]
pub fn get_cull_mask_bit(&self, layer: i64) -> bool
[src]
pub fn doppler_tracking(&self) -> DopplerTracking
[src]
pub fn environment(&self) -> Option<Ref<Environment, Shared>>
[src]
pub fn fov(&self) -> f64
[src]
pub fn get_frustum(&self) -> VariantArray<Shared>
[src]
pub fn frustum_offset(&self) -> Vector2D<f32, UnknownUnit>
[src]
pub fn h_offset(&self) -> f64
[src]
pub fn keep_aspect_mode(&self) -> KeepAspect
[src]
pub fn projection(&self) -> Projection
[src]
pub fn size(&self) -> f64
[src]
pub fn v_offset(&self) -> f64
[src]
pub fn zfar(&self) -> f64
[src]
pub fn znear(&self) -> f64
[src]
pub fn is_current(&self) -> bool
[src]
pub fn is_position_behind(
&self,
world_point: Vector3D<f32, UnknownUnit>
) -> bool
[src]
&self,
world_point: Vector3D<f32, UnknownUnit>
) -> bool
pub fn make_current(&self)
[src]
pub fn project_local_ray_normal(
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
pub fn project_position(
&self,
screen_point: Vector2D<f32, UnknownUnit>,
z_depth: f64
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
screen_point: Vector2D<f32, UnknownUnit>,
z_depth: f64
) -> Vector3D<f32, UnknownUnit>
pub fn project_ray_normal(
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
pub fn project_ray_origin(
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
screen_point: Vector2D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
pub fn set_cull_mask(&self, mask: i64)
[src]
pub fn set_cull_mask_bit(&self, layer: i64, enable: bool)
[src]
pub fn set_current(&self, arg0: bool)
[src]
pub fn set_doppler_tracking(&self, mode: i64)
[src]
pub fn set_environment(&self, env: impl AsArg<Environment>)
[src]
pub fn set_fov(&self, arg0: f64)
[src]
pub fn set_frustum(
&self,
size: f64,
offset: Vector2D<f32, UnknownUnit>,
z_near: f64,
z_far: f64
)
[src]
&self,
size: f64,
offset: Vector2D<f32, UnknownUnit>,
z_near: f64,
z_far: f64
)
pub fn set_frustum_offset(&self, arg0: Vector2D<f32, UnknownUnit>)
[src]
pub fn set_h_offset(&self, ofs: f64)
[src]
pub fn set_keep_aspect_mode(&self, mode: i64)
[src]
pub fn set_orthogonal(&self, size: f64, z_near: f64, z_far: f64)
[src]
pub fn set_perspective(&self, fov: f64, z_near: f64, z_far: f64)
[src]
pub fn set_projection(&self, arg0: i64)
[src]
pub fn set_size(&self, arg0: f64)
[src]
pub fn set_v_offset(&self, ofs: f64)
[src]
pub fn set_zfar(&self, arg0: f64)
[src]
pub fn set_znear(&self, arg0: f64)
[src]
pub fn unproject_position(
&self,
world_point: Vector3D<f32, UnknownUnit>
) -> Vector2D<f32, UnknownUnit>
[src]
&self,
world_point: Vector3D<f32, UnknownUnit>
) -> Vector2D<f32, UnknownUnit>
Methods from Deref<Target = Spatial>
pub const NOTIFICATION_ENTER_WORLD: i64
[src]
pub const NOTIFICATION_EXIT_WORLD: i64
[src]
pub const NOTIFICATION_TRANSFORM_CHANGED: i64
[src]
pub const NOTIFICATION_VISIBILITY_CHANGED: i64
[src]
pub fn force_update_transform(&self)
[src]
pub fn gizmo(&self) -> Option<Ref<SpatialGizmo, Shared>>
[src]
pub fn global_transform(&self) -> Transform
[src]
pub fn get_parent_spatial(&self) -> Option<Ref<Spatial, Shared>>
[src]
pub fn rotation(&self) -> Vector3D<f32, UnknownUnit>
[src]
pub fn rotation_degrees(&self) -> Vector3D<f32, UnknownUnit>
[src]
pub fn scale(&self) -> Vector3D<f32, UnknownUnit>
[src]
pub fn transform(&self) -> Transform
[src]
pub fn translation(&self) -> Vector3D<f32, UnknownUnit>
[src]
pub fn get_world(&self) -> Option<Ref<World, Shared>>
[src]
pub fn global_rotate(&self, axis: Vector3D<f32, UnknownUnit>, angle: f64)
[src]
pub fn global_scale(&self, scale: Vector3D<f32, UnknownUnit>)
[src]
pub fn global_translate(&self, offset: Vector3D<f32, UnknownUnit>)
[src]
pub fn hide(&self)
[src]
pub fn is_local_transform_notification_enabled(&self) -> bool
[src]
pub fn is_scale_disabled(&self) -> bool
[src]
pub fn is_set_as_toplevel(&self) -> bool
[src]
pub fn is_transform_notification_enabled(&self) -> bool
[src]
pub fn is_visible(&self) -> bool
[src]
pub fn is_visible_in_tree(&self) -> bool
[src]
pub fn look_at(
&self,
target: Vector3D<f32, UnknownUnit>,
up: Vector3D<f32, UnknownUnit>
)
[src]
&self,
target: Vector3D<f32, UnknownUnit>,
up: Vector3D<f32, UnknownUnit>
)
pub fn look_at_from_position(
&self,
position: Vector3D<f32, UnknownUnit>,
target: Vector3D<f32, UnknownUnit>,
up: Vector3D<f32, UnknownUnit>
)
[src]
&self,
position: Vector3D<f32, UnknownUnit>,
target: Vector3D<f32, UnknownUnit>,
up: Vector3D<f32, UnknownUnit>
)
pub fn orthonormalize(&self)
[src]
pub fn rotate(&self, axis: Vector3D<f32, UnknownUnit>, angle: f64)
[src]
pub fn rotate_object_local(&self, axis: Vector3D<f32, UnknownUnit>, angle: f64)
[src]
pub fn rotate_x(&self, angle: f64)
[src]
pub fn rotate_y(&self, angle: f64)
[src]
pub fn rotate_z(&self, angle: f64)
[src]
pub fn scale_object_local(&self, scale: Vector3D<f32, UnknownUnit>)
[src]
pub fn set_as_toplevel(&self, enable: bool)
[src]
pub fn set_disable_scale(&self, disable: bool)
[src]
pub fn set_gizmo(&self, gizmo: impl AsArg<SpatialGizmo>)
[src]
pub fn set_global_transform(&self, global: Transform)
[src]
pub fn set_identity(&self)
[src]
pub fn set_ignore_transform_notification(&self, enabled: bool)
[src]
pub fn set_notify_local_transform(&self, enable: bool)
[src]
pub fn set_notify_transform(&self, enable: bool)
[src]
pub fn set_rotation(&self, euler: Vector3D<f32, UnknownUnit>)
[src]
pub fn set_rotation_degrees(&self, euler_degrees: Vector3D<f32, UnknownUnit>)
[src]
pub fn set_scale(&self, scale: Vector3D<f32, UnknownUnit>)
[src]
pub fn set_transform(&self, local: Transform)
[src]
pub fn set_translation(&self, translation: Vector3D<f32, UnknownUnit>)
[src]
pub fn set_visible(&self, visible: bool)
[src]
pub fn show(&self)
[src]
pub fn to_global(
&self,
local_point: Vector3D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
local_point: Vector3D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
pub fn to_local(
&self,
global_point: Vector3D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]
&self,
global_point: Vector3D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
pub fn translate(&self, offset: Vector3D<f32, UnknownUnit>)
[src]
pub fn translate_object_local(&self, offset: Vector3D<f32, UnknownUnit>)
[src]
pub fn update_gizmo(&self)
[src]
Trait Implementations
impl Debug for Camera
[src]
impl Deref for Camera
[src]
impl DerefMut for Camera
[src]
impl GodotObject for Camera
[src]
type RefKind = ManuallyManaged
The memory management kind of this type. This modifies the behavior of the Ref
smart pointer. See its type-level documentation for more information. Read more
fn class_name() -> &'static str
[src]
fn null() -> Null<Self>
[src]
fn new() -> Ref<Self, Unique> where
Self: Instanciable,
[src]
Self: Instanciable,
fn cast<T>(&self) -> Option<&T> where
T: GodotObject + SubClass<Self>,
[src]
T: GodotObject + SubClass<Self>,
fn upcast<T>(&self) -> &T where
Self: SubClass<T>,
T: GodotObject,
[src]
Self: SubClass<T>,
T: GodotObject,
unsafe fn assume_shared(&self) -> Ref<Self, Shared>
[src]
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
[src]
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_unique(&self) -> Ref<Self, Unique>
[src]
impl Instanciable for Camera
[src]
impl QueueFree for Camera
[src]
unsafe fn godot_queue_free(obj: *mut c_void)
[src]
impl SubClass<Camera> for InterpolatedCamera
[src]
impl SubClass<Camera> for ClippedCamera
[src]
impl SubClass<Camera> for ARVRCamera
[src]
impl SubClass<Node> for Camera
[src]
impl SubClass<Object> for Camera
[src]
impl SubClass<Spatial> for Camera
[src]
Auto Trait Implementations
impl RefUnwindSafe for Camera
impl !Send for Camera
impl !Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SubClass<T> for T where
T: GodotObject,
[src]
T: GodotObject,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,