pub struct Transform {
pub translation: [f32; 3],
pub rotation: [f32; 4],
pub scale: [f32; 3],
}Expand description
Translation / Rotation / Scale. Rotation is a quaternion stored as [x, y, z, w].
Fields§
§translation: [f32; 3]§rotation: [f32; 4]§scale: [f32; 3]Implementations§
Source§impl Transform
impl Transform
pub const IDENTITY: Transform
pub fn from_parts(translation: Vec3, rotation: Quat, scale: Vec3) -> Self
pub fn translation_vec(&self) -> Vec3
pub fn rotation_quat(&self) -> Quat
pub fn scale_vec(&self) -> Vec3
pub fn to_mat4(&self) -> Mat4
Trait Implementations§
impl Copy for Transform
Source§impl<'de> Deserialize<'de> for Transform
impl<'de> Deserialize<'de> for Transform
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 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