[−][src]Trait webgl_matrix::Matrix
The base Matrix trait
Associated Types
type MatrixType
type VectorType
Required methods
fn zeros() -> Self::MatrixType
Create a matrix filled with zeros
fn ones() -> Self::MatrixType
Create a matrix filled with ones
fn identity() -> Self::MatrixType
Create the identity matrix
fn copy_to(&self, dst: &mut Self::MatrixType)
Copy values to another matrix
fn transpose(&mut self) -> &mut Self::MatrixType
Compute the transpose of this matrix
fn mul(&mut self, rhs: &Self::MatrixType) -> &mut Self::MatrixType
Perform matrix-multiplication with the given right-hand-side operand
fn mul_vector(&self, rhs: &[f32]) -> Self::VectorType
Multiplies this matrix with the given right-hand-side vector, i.e. Matrix * rhs
Depending on dimensionality, the homogenous coordinate can be omitted, if so, it will be assumed to be equal to 1.
fn mul_vector_left(&self, lhs: &[f32]) -> Self::VectorType
Multiplies the given row vector with this matrix, i.e. lhs * Matrix
Depending on dimensionality, the homogenous coordinate can be omitted, if so, it will be assumed to be equal to 1.
fn add(&mut self, rhs: &Self::MatrixType) -> &mut Self::MatrixType
Perform element-wise addition with the given right-hand-side operand
fn sub(&mut self, rhs: &Self::MatrixType) -> &mut Self::MatrixType
Perform element-wise substraction with the given right-hand-side operand
fn scale(&mut self, factor: f32) -> &mut Self::MatrixType
Scale the matrix elment-wise by the given constant
fn inverse(&mut self) -> Option<&mut Self::MatrixType>
Compute the inverse of this matrix. Returns None
if it is singular.
fn det(&self) -> f32
Compute the determinant of this matrix.
fn adjugate(&mut self) -> &mut Self::MatrixType
Compute the adjugate of this matrix
fn translate(&mut self, direction: &[f32]) -> &mut Self::MatrixType
Translate this matrix into the given direction
Depending on dimensionality, the homogenous coordinate of direction
can be omitted,
if so, it will be assumed to be equal to 1.
fn rotate(&mut self, angle: f32, axis: &[f32]) -> &mut Self::MatrixType
Rotate this matrix by the given angle (radians) around the given axis
Depending on dimensionality, the homogenous coordinate of axis
can be omitted,
if so, it will be assumed to be equal to 1.
Implementors
impl Matrix for Mat3
[src]
type MatrixType = Mat3
type VectorType = [f32; 3]
fn zeros() -> Self
[src]
fn ones() -> Self
[src]
fn identity() -> Self
[src]
fn copy_to(&self, dst: &mut Self)
[src]
fn transpose(&mut self) -> &mut Self
[src]
fn mul(&mut self, rhs: &Self) -> &mut Self
[src]
fn mul_vector(&self, rhs: &[f32]) -> [f32; 3]
[src]
fn mul_vector_left(&self, lhs: &[f32]) -> [f32; 3]
[src]
fn add(&mut self, rhs: &Self) -> &mut Self
[src]
fn sub(&mut self, rhs: &Self) -> &mut Self
[src]
fn scale(&mut self, factor: f32) -> &mut Self
[src]
fn inverse(&mut self) -> Option<&mut Self>
[src]
fn det(&self) -> f32
[src]
fn adjugate(&mut self) -> &mut Self
[src]
fn translate(&mut self, direction: &[f32]) -> &mut Self
[src]
fn rotate(&mut self, angle: f32, _: &[f32]) -> &mut Self
[src]
Rotate the matrix around the Z-axis.
The axis
argument is ignored.