bevy_transform::commands

Trait 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;
}
Available on crate feature bevy-support only.
Expand description

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

Required Methods§

Source

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).

Source

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).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BuildChildrenTransformExt for EntityCommands<'_>

Source§

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

Source§

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

Implementors§