Function avian3d::sync::position_to_transform

source ·
pub fn position_to_transform(
    query: Query<'_, '_, (&'static mut Transform, &'static Position, &'static Rotation, Option<&'static Parent>), (With<RigidBody>, Or<(Changed<Position>, Changed<Rotation>)>)>,
    parents: Query<'_, '_, (&'static GlobalTransform, Option<&'static Position>, Option<&'static Rotation>), With<Children>>
)
Expand description

Copies Position and Rotation changes to Transform. This allows users and the engine to use these components for moving and positioning bodies.

Nested rigid bodies move independently of each other, so the Transforms of child entities are updated based on their own and their parent’s Position and Rotation.