pub type Mat4 = [f32; 16];
Trait Implementations§
Source§impl Matrix for Mat4
impl Matrix for Mat4
type MatrixType = [f32; 16]
type VectorType = [f32; 4]
Source§fn mul(&mut self, rhs: &Self) -> &mut Self
fn mul(&mut self, rhs: &Self) -> &mut Self
Perform matrix-multiplication with the given right-hand-side operand
Source§fn mul_vector(&self, rhs: &[f32]) -> Vec4
fn mul_vector(&self, rhs: &[f32]) -> Vec4
Multiplies this matrix with the given right-hand-side vector, i.e.
Matrix * rhs
Read moreSource§fn mul_vector_left(&self, lhs: &[f32]) -> Vec4
fn mul_vector_left(&self, lhs: &[f32]) -> Vec4
Multiplies the given row vector with this matrix, i.e.
lhs * Matrix
Read moreSource§fn add(&mut self, rhs: &Self) -> &mut Self
fn add(&mut self, rhs: &Self) -> &mut Self
Perform element-wise addition with the given right-hand-side operand
Source§fn sub(&mut self, rhs: &Self) -> &mut Self
fn sub(&mut self, rhs: &Self) -> &mut Self
Perform element-wise substraction with the given right-hand-side operand
Source§fn scale(&mut self, factor: f32) -> &mut Self
fn scale(&mut self, factor: f32) -> &mut Self
Scale the matrix elment-wise by the given constant
Source§fn inverse(&mut self) -> Option<&mut Self>
fn inverse(&mut self) -> Option<&mut Self>
Compute the inverse of this matrix. Returns
None
if it is singular.