bevy_transform::bundles

Struct TransformBundle

source
pub struct TransformBundle {
    pub local: Transform,
    pub global: GlobalTransform,
}
๐Ÿ‘ŽDeprecated since 0.15.0: Use the Transform component instead. Inserting Transform will now also insert a GlobalTransform automatically.
Expand description

A Bundle of the Transform and GlobalTransform Components, which describe the position of an entity.

ยงTransform and GlobalTransform

Transform is the position of an entity relative to its parent position, or the reference frame if it doesnโ€™t have a parent.

GlobalTransform is the position of an entity relative to the reference frame.

GlobalTransform is updated from Transform by systems in the system set TransformPropagate.

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.

Fieldsยง

ยงlocal: Transform
๐Ÿ‘ŽDeprecated since 0.15.0: Use the Transform component instead. Inserting Transform will now also insert a GlobalTransform automatically.

The transform of the entity.

ยงglobal: GlobalTransform
๐Ÿ‘ŽDeprecated since 0.15.0: Use the Transform component instead. Inserting Transform will now also insert a GlobalTransform automatically.

The global transform of the entity.

Implementationsยง

sourceยง

impl TransformBundle

source

pub const IDENTITY: Self = _

An identity TransformBundle with no translation, rotation, and a scale of 1 on all axes.

source

pub const fn from_transform(transform: Transform) -> Self

Creates a new TransformBundle from a Transform.

This initializes GlobalTransform as identity, to be updated later by the bevy_app::PostUpdate schedule.

Trait Implementationsยง

sourceยง

impl Bundle for TransformBundle

sourceยง

fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )

Gets this Bundleโ€™s component ids. This will be None if the component has not been registered.
sourceยง

fn register_required_components( components: &mut Components, storages: &mut Storages, required_components: &mut RequiredComponents, )

Registers components that are required by the components in this Bundle.
sourceยง

impl Clone for TransformBundle

sourceยง

fn clone(&self) -> TransformBundle

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl Debug for TransformBundle

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

impl Default for TransformBundle

sourceยง

fn default() -> TransformBundle

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl From<Transform> for TransformBundle

sourceยง

fn from(transform: Transform) -> Self

Converts to this type from the input type.
sourceยง

impl Copy for TransformBundle

sourceยง

impl DynamicBundle for TransformBundle

Auto Trait Implementationsยง

Blanket Implementationsยง

sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
sourceยง

impl<T> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
sourceยง

impl<T> Downcast for T
where T: Any,

sourceยง

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
sourceยง

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
sourceยง

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Anyโ€™s vtable from &Traitโ€™s.
sourceยง

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Anyโ€™s vtable from &mut Traitโ€™s.
sourceยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

sourceยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
sourceยง

impl<T> From<T> for T

sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

sourceยง

impl<T> FromWorld for T
where T: Default,

sourceยง

fn from_world(_world: &mut World) -> T

Creates Self using default().

sourceยง

impl<T> Instrument for T

sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

sourceยง

impl<T> IntoEither for T

sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
sourceยง

impl<T> ToOwned for T
where T: Clone,

sourceยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
sourceยง

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

sourceยง

fn vzip(self) -> V

sourceยง

impl<T> WithSubscriber for T

sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
sourceยง

impl<T> ConditionalSend for T
where T: Send,