GlobalTransform
GlobalTransform
- glam::Affine3A
Description
[
GlobalTransform
] is an affine transformation from entity-local coordinates to worldspace coordinates.You cannot directly mutate [
GlobalTransform
]; instead, you change an entity's transform by manipulating its [Transform
], which indirectly causes Bevy to update its [GlobalTransform
].
- To get the global transform of an entity, you should get its [
GlobalTransform
].- For transform hierarchies to work correctly, you must have both a [
Transform
] and a [GlobalTransform
].
You may use theTransformBundle
to guarantee this.TransformBundle
is now deprecated. [GlobalTransform
] is automatically inserted whenever [Transform
] is inserted.[
Transform
] and [GlobalTransform
][
Transform
] transforms an entity relative to its parent's reference frame, or relative to world space coordinates, if it doesn't have aParent
.[
GlobalTransform
] is managed by Bevy; it is computed by successively applying the [Transform
] of each ancestor entity which has a Transform. This is done automatically by Bevy-internal systems in the system setTransformPropagate
.This system runs during
PostUpdate
. If you update the [Transform
] of an entity in this schedule or after, you will notice a 1 frame lag before the [GlobalTransform
] is updated.Examples