pub struct Transform {
pub translation: Vec3,
pub rotation: Quaternion,
pub scale: Vec3,
}
Expand description
A component that describes an entity’s position, rotation, and scale
relative to its Parent
. If the entity has no Parent
, this is relative
to the world origin.
This is the component that users and other systems should modify. A dedicated
transform propagation system will use this component’s value to calculate
the final GlobalTransform
.
Fields§
§translation: Vec3
The translation (position) of the entity.
rotation: Quaternion
The rotation of the entity, represented as a quaternion.
scale: Vec3
The scale of the entity.
Implementations§
Source§impl Transform
impl Transform
Trait Implementations§
impl Component for Transform
impl Copy for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C1> ComponentBundle for C1where
C1: Component,
impl<C1> ComponentBundle for C1where
C1: Component,
Source§fn type_ids() -> Vec<TypeId>
fn type_ids() -> Vec<TypeId>
Returns the sorted list of
TypeId
s for the components in this bundle. Read moreSource§fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
Creates the set of empty, type-erased
Vec<T>
columns required to store
this bundle’s components. Read moreSource§fn update_metadata(
metadata: &mut EntityMetadata,
location: PageIndex,
registry: &ComponentRegistry,
)
fn update_metadata( metadata: &mut EntityMetadata, location: PageIndex, registry: &ComponentRegistry, )
Updates the appropriate fields in an
EntityMetadata
struct to point
to the location of this bundle’s data. Read moreSource§unsafe fn add_to_page(self, page: &mut ComponentPage)
unsafe fn add_to_page(self, page: &mut ComponentPage)
Adds the components from this bundle into the specified
ComponentPage
. Read more