Trait mafs::Mat4

source ·
pub trait Mat4<S, V>where
    Self: MatOps<S, V>,
    S: Float,
    V: Vec4<S>,{
    // Required methods
    fn from_columns(x: V, y: V, z: V, w: V) -> Self;
    fn as_array(&self) -> &[V; 4];
    fn as_mut_array(&mut self) -> &mut [V; 4];
    fn mul_vector(&self, rhs: V) -> V;
    fn transpose(&self) -> Self;

    // Provided methods
    fn splat(value: S) -> Self { ... }
    fn from_rows(r0: [S; 4], r1: [S; 4], r2: [S; 4], r3: [S; 4]) -> Self { ... }
    fn identity() -> Self { ... }
    fn add_componentwise(&self, rhs: Self) -> Self { ... }
    fn sub_componentwise(&self, rhs: Self) -> Self { ... }
    fn mul_matrix(&self, rhs: Self) -> Self { ... }
    fn inverse_se3(&self) -> Self { ... }
}
Expand description

Methods on a 4x4 matrices.

  • S is the type of the matrix’s components.
  • V is the type of the matrix’s columns.

Required Methods§

source

fn from_columns(x: V, y: V, z: V, w: V) -> Self

Create a new 4x4 matrix from its four columns.

source

fn as_array(&self) -> &[V; 4]

Convert to an array. Can also use the indexing operator [].

source

fn as_mut_array(&mut self) -> &mut [V; 4]

Convert to a mutable array. Can also use the indexing operator [].

source

fn mul_vector(&self, rhs: V) -> V

Multiply this matrix with a vector. Can also use the * operator.

source

fn transpose(&self) -> Self

Transpose.

Provided Methods§

source

fn splat(value: S) -> Self

Create a new 4x4 matrix with all equal components.

source

fn from_rows(r0: [S; 4], r1: [S; 4], r2: [S; 4], r3: [S; 4]) -> Self

Create a new 4x4 matrix from its four rows

source

fn identity() -> Self

Identity matrix.

source

fn add_componentwise(&self, rhs: Self) -> Self

Add component by component. Can also use the + operator.

source

fn sub_componentwise(&self, rhs: Self) -> Self

Subtract component by component. Can also use the - operator.

source

fn mul_matrix(&self, rhs: Self) -> Self

Multiply this matrix with another matrix. Can also use the * operator.

source

fn inverse_se3(&self) -> Self

Assume that this matrix is a rotation+translation matrix and computes its inverse. If this matrix is not a rotation+translation, the result will be nonsense.

Implementors§