pub trait Mat4<S, V>{
// 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§
Sourcefn from_columns(x: V, y: V, z: V, w: V) -> Self
fn from_columns(x: V, y: V, z: V, w: V) -> Self
Create a new 4x4 matrix from its four columns.
Sourcefn as_mut_array(&mut self) -> &mut [V; 4]
fn as_mut_array(&mut self) -> &mut [V; 4]
Convert to a mutable array.
Can also use the indexing operator []
.
Sourcefn mul_vector(&self, rhs: V) -> V
fn mul_vector(&self, rhs: V) -> V
Multiply this matrix with a vector.
Can also use the *
operator.
Provided Methods§
Sourcefn from_rows(r0: [S; 4], r1: [S; 4], r2: [S; 4], r3: [S; 4]) -> Self
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
Sourcefn add_componentwise(&self, rhs: Self) -> Self
fn add_componentwise(&self, rhs: Self) -> Self
Add component by component.
Can also use the +
operator.
Sourcefn sub_componentwise(&self, rhs: Self) -> Self
fn sub_componentwise(&self, rhs: Self) -> Self
Subtract component by component.
Can also use the -
operator.
Sourcefn mul_matrix(&self, rhs: Self) -> Self
fn mul_matrix(&self, rhs: Self) -> Self
Multiply this matrix with another matrix.
Can also use the *
operator.
Sourcefn inverse_se3(&self) -> Self
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.