Struct gdnative_bindings_lily::VisualInstance[][src]

pub struct VisualInstance { /* fields omitted */ }
Expand description

core class VisualInstance inherits Spatial (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.

Class hierarchy

VisualInstance 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

Returns the [AABB] (also known as the bounding box) for this VisualInstance. See also [method get_transformed_aabb].

Returns the RID of the resource associated with this VisualInstance. For example, if the Node is a MeshInstance, this will return the RID of the associated Mesh.

Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call VisualServer functions directly on this VisualInstance.

The render layer(s) this VisualInstance is drawn on. This object will only be visible for Cameras whose cull mask includes the render object this VisualInstance is set to.

Returns true when the specified layer is enabled in [member layers] and false otherwise.

Returns the transformed [AABB] (also known as the bounding box) for this VisualInstance. Transformed in this case means the [AABB] plus the position, rotation, and scale of the Spatial’s Transform. See also [method get_aabb].

Sets the resource that is instantiated by this VisualInstance, which changes how the engine handles the VisualInstance under the hood. Equivalent to [method VisualServer.instance_set_base].

The render layer(s) this VisualInstance is drawn on. This object will only be visible for Cameras whose cull mask includes the render object this VisualInstance is set to.

Enables a particular layer in [member layers].

Methods from Deref<Target = Spatial>

Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations.

The SpatialGizmo for this node. Used for example in EditorSpatialGizmo as custom visualization and editing handles in Editor.

World space (global) Transform of this node.

Returns the parent Spatial, or an empty Object if no parent exists or parent is not of type Spatial.

Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). Note: In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a Vector3 data structure not because the rotation is a vector, but only because Vector3 exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation “vector” is not meaningful.

Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).

Scale part of the local transformation.

Local space Transform of this node, with respect to the parent node.

Local translation of this node.

Returns the current World resource this Spatial node is registered to.

Rotates the global (world) transformation around axis, a unit Vector3, by specified angle in radians. The rotation axis is in global coordinate system.

Scales the global (world) transformation by the given Vector3 scale factors.

Moves the global (world) transformation by Vector3 offset. The offset is in global coordinate system.

Disables rendering of this node. Changes [member visible] to false.

Returns whether node notifies about its local transformation changes. Spatial will not propagate this by default.

Returns whether this node uses a scale of (1, 1, 1) or its local transformation scale.

Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations.

Returns whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default.

If true, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return true).

Returns true if the node is present in the SceneTree, its [member visible] property is true and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree.

Rotates itself so that the local -Z axis points towards the target position. The transform will first be rotated around the given up vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the target and up vectors. Operations take place in global space.

Moves the node to the specified position, and then rotates itself to point toward the target as per [method look_at]. Operations take place in global space.

Resets this node’s transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node’s Transform.

Rotates the local transformation around axis, a unit Vector3, by specified angle in radians.

Rotates the local transformation around axis, a unit Vector3, by specified angle in radians. The rotation axis is in object-local coordinate system.

Rotates the local transformation around the X axis by angle in radians.

Rotates the local transformation around the Y axis by angle in radians.

Rotates the local transformation around the Z axis by angle in radians.

Scales the local transformation by given 3D scale factors in object-local coordinate system.

Makes the node ignore its parents transformations. Node transformations are only in global space.

Sets whether the node uses a scale of (1, 1, 1) or its local transformation scale. Changes to the local transformation scale are preserved.

The SpatialGizmo for this node. Used for example in EditorSpatialGizmo as custom visualization and editing handles in Editor.

World space (global) Transform of this node.

Reset all transformations for this node (sets its Transform to the identity matrix).

Sets whether the node ignores notification that its transformation (global or local) changed.

Sets whether the node notifies about its local transformation changes. Spatial will not propagate this by default.

Sets whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default.

Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). Note: In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a Vector3 data structure not because the rotation is a vector, but only because Vector3 exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation “vector” is not meaningful.

Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).

Scale part of the local transformation.

Local space Transform of this node, with respect to the parent node.

Local translation of this node.

If true, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return true).

Enables rendering of this node. Changes [member visible] to true.

Transforms local_point from this node’s local space to world space.

Transforms global_point from world space to this node’s local space.

Changes the node’s position by the given offset Vector3. Note that the translation offset is affected by the node’s scale, so if scaled by e.g. (10, 1, 1), a translation by an offset of (2, 0, 0) would actually add 20 (2 * 10) to the X coordinate.

Changes the node’s position by the given offset Vector3 in local space.

Updates the SpatialGizmo of this node.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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

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

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

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive, and panics otherwise. This does NOT guarantee that the resulting reference is safe to use. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.