pub struct Transform {
pub position: [f32; 3],
pub rotation_deg: [f32; 3],
pub scale: [f32; 3],
}Expand description
World-space placement of an entity: translation, rotation, and scale.
Runtime-only placement state. Physics and interaction systems mutate it and
the renderer reads it to position draws. Not authored directly in a world
file; it carries the same transform fields a Prop declares.
Fields§
§position: [f32; 3]World-space position [x, y, z].
rotation_deg: [f32; 3]Euler rotation in degrees [pitch, yaw, roll], applied in YXZ order.
scale: [f32; 3]Non-uniform scale [x, y, z].
Implementations§
Trait Implementations§
Source§impl Component for Transform
impl Component for Transform
Source§const NAME: &'static str = "Transform"
const NAME: &'static str = "Transform"
The registry name a world authors this component under.
Source§fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for Transform
impl ComponentSlot for Transform
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
impl Copy for Transform
Source§impl From<Transform> for ComponentAsset
impl From<Transform> for ComponentAsset
impl RuntimeComponent 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 UnsafeUnpin 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