Trait bevy::prelude::BuildChildrenTransformExt
source · 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§
sourcefn set_parent_in_place(&mut self, parent: Entity) -> &mut Self
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
the next time commands are applied
(during apply_deferred
).
sourcefn remove_parent_in_place(&mut self) -> &mut Self
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
the next time commands are applied
(during apply_deferred
).