#[repr(C)]pub struct Mat3 {
pub cols: [Vec3; 3],
}Expand description
A 3x3 column-major matrix.
Fields§
§cols: [Vec3; 3]Matrix columns.
Implementations§
Source§impl Mat3
impl Mat3
Sourcepub const fn from_cols(c0: Vec3, c1: Vec3, c2: Vec3) -> Self
pub const fn from_cols(c0: Vec3, c1: Vec3, c2: Vec3) -> Self
Creates a matrix from column vectors.
Sourcepub fn from_diagonal(diag: Vec3) -> Self
pub fn from_diagonal(diag: Vec3) -> Self
Creates a diagonal matrix.
Sourcepub fn from_scale(scale: Vec2) -> Self
pub fn from_scale(scale: Vec2) -> Self
Creates a 2D scaling matrix.
Sourcepub fn from_translation(translation: Vec2) -> Self
pub fn from_translation(translation: Vec2) -> Self
Creates a 2D translation matrix.
Sourcepub fn from_rotation(angle: Float) -> Self
pub fn from_rotation(angle: Float) -> Self
Creates a 2D rotation matrix.
Sourcepub fn determinant(self) -> Float
pub fn determinant(self) -> Float
Computes the determinant.
Sourcepub fn try_inverse(self) -> Option<Self>
pub fn try_inverse(self) -> Option<Self>
Returns the inverse, or None if not invertible.
Sourcepub fn transform_point2(self, p: Vec2) -> Vec2
pub fn transform_point2(self, p: Vec2) -> Vec2
Transforms a 2D point (Vec2 with z=1).
Sourcepub fn transform_vector2(self, v: Vec2) -> Vec2
pub fn transform_vector2(self, v: Vec2) -> Vec2
Transforms a 2D vector (Vec2 with z=0).
Trait Implementations§
impl Copy for Mat3
impl StructuralPartialEq for Mat3
Auto Trait Implementations§
impl Freeze for Mat3
impl RefUnwindSafe for Mat3
impl Send for Mat3
impl Sync for Mat3
impl Unpin for Mat3
impl UnwindSafe for Mat3
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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