logo
pub struct Transform { /* private fields */ }
Expand description

Transform component.

Use to move and rotate entities (without physics).

Implementations

Returns a ValueAccessor for the local position of the entity.

Used to set/get/animate the position. Moves the entity to this position. If physics (non-kinematic) are enabled, it’s recommended to use forces instead of explicitly moving the entity.

Returns a ValueAccessor for the local rotation of the entity.

Used to set/get/animate the rotation (in quaternion format).

If physics (non-kinematic) are enabled, it’s recommended to use forces/torques instead of explicitly rotating the entity.

Returns a ValueAccessor for the local scale of the entity.

Used to set/get/animate the scale. Scale animation is not recommended for entities with physics enabled.

NOTE: scale values must be greater than (0, 0, 0)

Sets/gets the parent of the entity in the transform hierarchy.

Does not work for dynamic physics. If you change an object to use dynamic physics, the parent will be removed. Works for kinematic physics objects though.

Returns a ValueAccessor for the world position of the entity.

Used to get the current world position.

Returns a ValueAccessor for the world rotation of the entity.

Used to get the current rotation (in quaternion format).

Returns a ValueAccessor for the world scale of the entity.

Used to get the scale. Will be the scale of the last frame.

Returns the entity-to-parent transform as an Affine3A.

Set the entity-to-parent transform.

Returns the parent-to-entity transform as an Affine3A.

Set the parent-to-entity transform from an Affine3A.

Returns the entity-to-world transform as a decomposed Transform3 (translation, rotation, scale).

Sets the entity-to-world transform from a decomposed Transform3 (translation, rotation, scale).

Returns the entity-to-world transform as an Affine3A.

Set the entity-to-world transform from an Affine3A

Returns the world-to-entity transform as an Affine3A.

Set the world-to-entity transform.

Retrieves all the direct transform children of this entity

Retrieves all the transform descendants of this entity.

Trait Implementations

The type of the component, as a ComponentType enum.

Adopt an Entity, wrap in a component struct.

Get the entity that the component belongs to.

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.