Struct gdnative_bindings_lily::InterpolatedCamera [−][src]
pub struct InterpolatedCamera { /* fields omitted */ }
Expand description
core class InterpolatedCamera
inherits Camera
(unsafe).
Official documentation
See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.
Memory management
Non reference counted objects such as the ones of this type are usually owned by the engine.
InterpolatedCamera
is a reference-only type. Persistent references can
only exist in the unsafe Ref<InterpolatedCamera>
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 Ref::free
, or Ref::queue_free
if it is a Node
.
Class hierarchy
InterpolatedCamera 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
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 Ref::free
, or preferably
Ref::queue_free
if it is a Node
.
How quickly the camera moves toward its target. Higher values will result in tighter camera motion.
The target’s NodePath.
If true
, and a target is set, the camera will move automatically.
If true
, and a target is set, the camera will move automatically.
How quickly the camera moves toward its target. Higher values will result in tighter camera motion.
Sets the node to move toward and orient with.
The target’s NodePath.
Methods from Deref<Target = Camera>
If this is the current camera, remove it from being current. If enable_next
is true
, request to make the next camera current, if any.
Default Arguments
enable_next
-true
Returns the camera’s RID from the VisualServer.
Gets the camera transform. Subclassed cameras such as InterpolatedCamera may provide different transforms than the Node transform.
The culling mask that describes which 3D render layers are rendered by this camera.
Returns true
if the given layer
in the [member cull_mask] is enabled, false
otherwise.
If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular _process
methods. See [enum DopplerTracking] for possible values.
The Environment to use for this camera.
The camera’s field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, fov
sets the other axis’ field of view angle.
Returns the camera’s frustum planes in world-space units as an array of Planes in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset].
The camera’s frustum offset. This can be changed from the default to create “tilted frustum” effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url].
The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT].
The camera’s projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects’ Z distance from the camera’s local space scales their perceived size.
The camera’s size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since [member keep_aspect] locks on axis, size
sets the other axis’ size length.
The distance to the far culling boundary for this camera relative to its local Z axis.
The distance to the near culling boundary for this camera relative to its local Z axis.
If true
, the ancestor Viewport is currently using this camera.
Returns true
if the given position is behind the camera.
Note: A position which returns false
may still be outside the camera’s field of view.
Makes this camera the current camera for the Viewport (see class description). If the camera node is outside the scene tree, it will attempt to become current once it’s added.
Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc.
Returns the 3D point in worldspace that maps to the given 2D coordinate in the Viewport rectangle on a plane that is the given z_depth
distance into the scene away from the camera.
Returns a normal vector in worldspace, that is the result of projecting a point on the Viewport rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
Returns a 3D position in worldspace, that is the result of projecting a point on the Viewport rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking.
The culling mask that describes which 3D render layers are rendered by this camera.
Enables or disables the given layer
in the [member cull_mask].
If true
, the ancestor Viewport is currently using this camera.
If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular _process
methods. See [enum DopplerTracking] for possible values.
The Environment to use for this camera.
The camera’s field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, fov
sets the other axis’ field of view angle.
Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a size
, an offset
, and the z_near
and z_far
clip planes in world-space units.
The camera’s frustum offset. This can be changed from the default to create “tilted frustum” effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url].
The horizontal (X) offset of the camera viewport.
The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT].
Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a size
, and the z_near
and z_far
clip planes in world-space units. (As a hint, 2D games often use this projection, with values specified in pixels.)
Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a fov
(field of view) angle in degrees, and the z_near
and z_far
clip planes in world-space units.
The camera’s projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects’ Z distance from the camera’s local space scales their perceived size.
The camera’s size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since [member keep_aspect] locks on axis, size
sets the other axis’ size length.
The vertical (Y) offset of the camera viewport.
The distance to the far culling boundary for this camera relative to its local Z axis.
The distance to the near culling boundary for this camera relative to its local Z axis.
Returns the 2D coordinate in the Viewport rectangle that maps to the given 3D point in worldspace.
Trait Implementations
type RefKind = ManuallyManaged
type RefKind = ManuallyManaged
Creates an explicitly null reference of Self
as a method argument. This makes type
inference easier for the compiler compared to Option
. Read more
Creates a new instance of Self
using a zero-argument constructor, as a Unique
reference. Read more
Performs a dynamic reference downcast to target type. Read more
Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more
Creates a persistent reference to the same Godot object with shared thread access. Read more
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
Creates a persistent reference to the same Godot object with thread-local thread access. Read more
Creates a persistent reference to the same Godot object with unique access. Read more
Recovers a instance ID previously returned by Object::get_instance_id
if the object is
still alive. See also TRef::try_from_instance_id
. Read more
Auto Trait Implementations
impl RefUnwindSafe for InterpolatedCamera
impl !Send for InterpolatedCamera
impl !Sync for InterpolatedCamera
impl Unpin for InterpolatedCamera
impl UnwindSafe for InterpolatedCamera