pub struct Transform { /* private fields */ }Expand description
A node transform stored as a 4x4 matrix (column-major order).
Wraps a glam::Mat4 in a plain [[f32; 4]; 4] so it can cross FFI
boundaries; every operation goes through glam under the hood.
Implementations§
Source§impl Transform
impl Transform
Sourcepub fn from_matrix(matrix: [[f32; 4]; 4]) -> Self
pub fn from_matrix(matrix: [[f32; 4]; 4]) -> Self
Creates a transform from a column-major matrix array.
Sourcepub fn from_translation(translation: Vec3) -> Self
pub fn from_translation(translation: Vec3) -> Self
Creates a transform containing only a translation.
Sourcepub fn from_scale_rotation_translation(
scale: Vec3,
rotation: Quat,
translation: Vec3,
) -> Self
pub fn from_scale_rotation_translation( scale: Vec3, rotation: Quat, translation: Vec3, ) -> Self
Creates a transform from scale, rotation, and translation components.
Sourcepub fn translation(&self) -> Vec3
pub fn translation(&self) -> Vec3
Extracts the translation component.
Sourcepub fn to_scale_rotation_translation(&self) -> (Vec3, Quat, Vec3)
pub fn to_scale_rotation_translation(&self) -> (Vec3, Quat, Vec3)
Decomposes this transform into scale, rotation, and translation.
Trait Implementations§
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 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