Type Alias Mat4

Source
pub type Mat4 = [f32; 16];

Trait Implementations§

Source§

impl Matrix for Mat4

Source§

type MatrixType = [f32; 16]

Source§

type VectorType = [f32; 4]

Source§

fn zeros() -> Self

Create a matrix filled with zeros
Source§

fn ones() -> Self

Create a matrix filled with ones
Source§

fn identity() -> Self

Create the identity matrix
Source§

fn copy_to(&self, dst: &mut Self)

Copy values to another matrix
Source§

fn transpose(&mut self) -> &mut Self

Compute the transpose of this matrix
Source§

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

Multiplies this matrix with the given right-hand-side vector, i.e. Matrix * rhs Read more
Source§

fn mul_vector_left(&self, lhs: &[f32]) -> Vec4

Multiplies the given row vector with this matrix, i.e. lhs * Matrix Read more
Source§

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

Perform element-wise substraction with the given right-hand-side operand
Source§

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>

Compute the inverse of this matrix. Returns None if it is singular.
Source§

fn det(&self) -> f32

Compute the determinant of this matrix.
Source§

fn adjugate(&mut self) -> &mut Self

Compute the adjugate of this matrix
Source§

fn translate(&mut self, direction: &[f32]) -> &mut Self

Translate this matrix into the given direction Read more
Source§

fn rotate(&mut self, angle: f32, axis: &[f32]) -> &mut Self

Rotate this matrix by the given angle (radians) around the given axis Read more
Source§

impl ProjectionMatrix for Mat4

Source§

fn create_perspective( fov_y: f32, aspect_ratio: f32, near: f32, far: f32, ) -> Self

Source§

fn create_perspective_from_viewport( vp_left: f32, vp_right: f32, vp_bot: f32, vp_top: f32, near: f32, far: f32, ) -> Self

Source§

fn create_orthogonal_from_viewport( vp_left: f32, vp_right: f32, vp_bot: f32, vp_top: f32, near: f32, far: f32, ) -> Self