Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§