pub trait BuildChildrenTransformExt {
    // Required methods
    fn set_parent_in_place(&mut self, parent: Entity) -> &mut Self;
    fn remove_parent_in_place(&mut self) -> &mut Self;
}
Expand description

Collection of methods similar to [BuildChildren], but preserving each entity’s GlobalTransform.

Required Methods§

fn set_parent_in_place(&mut self, parent: Entity) -> &mut Self

Change this entity’s parent while preserving this entity’s GlobalTransform by updating its Transform.

See [BuildChildren::set_parent] for a method that doesn’t update the Transform.

Note that both the hierarchy and transform updates will only execute at the end of the current stage.

fn remove_parent_in_place(&mut self) -> &mut Self

Make this entity parentless while preserving this entity’s GlobalTransform by updating its Transform to be equal to its current GlobalTransform.

See [BuildChildren::remove_parent] for a method that doesn’t update the Transform.

Note that both the hierarchy and transform updates will only execute at the end of the current stage.

Implementors§

§

impl<'w, 's, 'a> BuildChildrenTransformExt for EntityCommands<'w, 's, 'a>