Struct bevy::transform::components::GlobalTransform[]

pub struct GlobalTransform {
    pub translation: Vec3,
    pub rotation: Quat,
    pub scale: Vec3,
}

Describe the position of an entity relative to the reference frame.

Transform and GlobalTransform

Transform is the position of an entity relative to its parent position, or the reference frame if it doesn’t have a Parent.

GlobalTransform is the position of an entity relative to the reference frame.

GlobalTransform is updated from Transform in the system transform_propagate_system.

In pseudo code:

for entity in entities_without_parent:
    set entity.global_transform to entity.transform
    recursively:
        set parent to current entity
        for child in parent.children:
            set child.global_transform to parent.global_transform * child.transform

This system runs in stage CoreStage::PostUpdate. If you update theTransform of an entity in this stage or after, you will notice a 1 frame lag before the GlobalTransform is updated.

Fields

translation: Vec3rotation: Quatscale: Vec3

Implementations

impl GlobalTransform

pub const fn identity() -> GlobalTransform

Creates a new identity GlobalTransform, with no translation, rotation, and a scale of 1 on all axes.

pub fn compute_matrix(&self) -> Mat4

Returns the 3d affine transformation matrix from this transforms translation, rotation, and scale.

pub fn local_x(&self) -> Vec3

Get the unit vector in the local x direction

pub fn local_y(&self) -> Vec3

Get the unit vector in the local y direction

pub fn local_z(&self) -> Vec3

Get the unit vector in the local z direction

pub fn mul_transform(&self, transform: Transform) -> GlobalTransform

Multiplies self with transform component by component, returning the resulting GlobalTransform

pub fn mul_vec3(&self, value: Vec3) -> Vec3

Returns a Vec3 of this Transform applied to value.

Trait Implementations

impl Clone for GlobalTransform

impl Copy for GlobalTransform

impl Debug for GlobalTransform

impl Default for GlobalTransform

impl From<GlobalTransform> for Transform

impl From<Transform> for GlobalTransform

impl GetTypeRegistration for GlobalTransform

impl Mul<GlobalTransform> for GlobalTransform

type Output = GlobalTransform

The resulting type after applying the * operator.

impl Mul<Transform> for GlobalTransform

type Output = GlobalTransform

The resulting type after applying the * operator.

impl Mul<Vec3> for GlobalTransform

type Output = Vec3

The resulting type after applying the * operator.

impl PartialEq<GlobalTransform> for GlobalTransform

impl Reflect for GlobalTransform

impl RenderResource for GlobalTransform

impl RenderResources for GlobalTransform

impl Struct for GlobalTransform

impl StructuralPartialEq for GlobalTransform

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Any + Clone

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> Downcast<T> for T

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> FromWorld for T where
    T: Default

impl<S> GetField for S where
    S: Struct

impl<T> GetPath for T where
    T: Reflect

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> TypeData for T where
    T: 'static + Send + Sync + Clone

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,