pub struct Transform {
pub matrix: [f32; 16],
}Expand description
A 4×4 column-major transform matrix (identity by default).
Fields§
§matrix: [f32; 16]Implementations§
Source§impl Transform
impl Transform
Sourcepub fn translation(x: f32, y: f32, z: f32) -> Self
pub fn translation(x: f32, y: f32, z: f32) -> Self
Translation transform: moves by (x, y, z). Column-major layout means the translation lives in column 3 (indices 12..14).
Sourcepub fn compose(&self, other: &Transform) -> Transform
pub fn compose(&self, other: &Transform) -> Transform
Matrix multiply: self * other (column-major 4×4).
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Returns true iff the matrix is (approximately) the identity.
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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