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: f32
Implementations
sourceimpl Matrix
impl Matrix
sourcepub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Matrix
pub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Matrix
Scale, then rotate Quaternion (axis, angle), then translate.
sourcepub fn rt(self, rotate: Rotation, translate: Vector) -> Matrix
pub fn rt(self, rotate: Rotation, translate: Vector) -> Matrix
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
) -> Matrix
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
) -> Matrix
Full constructor.
sourcepub fn orthographic_projection(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Matrix
pub fn orthographic_projection(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Matrix
Orthographic projection matrix constructor.
sourcepub fn finite_perspective_projection(
fovy: f32,
aspect: f32,
near: f32,
far: f32
) -> Matrix
pub fn finite_perspective_projection(
fovy: f32,
aspect: f32,
near: f32,
far: f32
) -> Matrix
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 RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more