#[repr(C)]pub struct Matrix {}Expand description
4x4 Matrix.
Fields§
§m00: f32§m01: f32§m02: f32§m03: f32§m10: f32§m11: f32§m12: f32§m13: f32§m20: f32§m21: f32§m22: f32§m23: f32§m30: f32§m31: f32§m32: f32§m33: f32Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Self
pub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Self
Scale, then rotate Quaternion (axis, angle), then translate.
Sourcepub fn rt(self, rotate: Rotation, translate: Vector) -> Self
pub fn rt(self, rotate: Rotation, translate: Vector) -> Self
Rotate Quaternion (axis, angle), then translate.
Sourcepub fn new(
m00: f32,
m01: f32,
m02: f32,
m03: f32,
m10: f32,
m11: f32,
m12: f32,
m13: f32,
m20: f32,
m21: f32,
m22: f32,
m23: f32,
m30: f32,
m31: f32,
m32: f32,
m33: f32,
) -> Self
pub fn new( m00: f32, m01: f32, m02: f32, m03: f32, m10: f32, m11: f32, m12: f32, m13: f32, m20: f32, m21: f32, m22: f32, m23: f32, m30: f32, m31: f32, m32: f32, m33: f32, ) -> Self
Full constructor.
Sourcepub fn tridiagonal(lo: f32, di: f32, up: f32) -> Self
pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Self
Tri-diagonal constructor.
Sourcepub fn orthographic_projection(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32,
) -> Self
pub fn orthographic_projection( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> Self
Orthographic projection matrix constructor.
Sourcepub fn finite_perspective_projection(
fovy: f32,
aspect: f32,
near: f32,
far: f32,
) -> Self
pub fn finite_perspective_projection( fovy: f32, aspect: f32, near: f32, far: f32, ) -> Self
Finite perspective projection matrix constructor.
Sourcepub fn determinant(self) -> f32
pub fn determinant(self) -> f32
Computes the matrix determinant.
Sourcepub fn inverse(self) -> Matrix
pub fn inverse(self) -> Matrix
Computes the matrix inverse.
§Panics
Panics if the matrix has no inverse (i.e. has zero determinant).
Sourcepub fn try_invert(self) -> Option<Matrix>
pub fn try_invert(self) -> Option<Matrix>
Attempts to compute the matrix inverse, returning None if the matrix is
non-invertible (i.e. has zero determinant).
Trait Implementations§
impl Copy for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
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