Struct ami::Matrix [−][src]
#[repr(C)]pub struct Matrix { pub m00: f32, pub m01: f32, pub m02: f32, pub m03: f32, pub m10: f32, pub m11: f32, pub m12: f32, pub m13: f32, pub m20: f32, pub m21: f32, pub m22: f32, pub m23: f32, pub m30: f32, pub m31: f32, pub m32: f32, pub m33: f32, }
4x4 Matrix.
Fields
m00: f32
m01: f32
m02: f32
m03: f32
m10: f32
m11: f32
m12: f32
m13: f32
m20: f32
m21: f32
m22: f32
m23: f32
m30: f32
m31: f32
m32: f32
m33: f32
Methods
impl Matrix
[src]
impl Matrix
pub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Self
[src]
pub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Self
Scale, then rotate Quaternion (axis, angle), then translate.
pub fn rt(self, rotate: Rotation, translate: Vector) -> Self
[src]
pub fn rt(self, rotate: Rotation, translate: Vector) -> Self
Rotate Quaternion (axis, angle), then translate.
pub fn st(self, scale: Vector, translate: Vector) -> Self
[src]
pub fn st(self, scale: Vector, translate: Vector) -> Self
Scale, then translate.
pub fn t(self, translate: Vector) -> Self
[src]
pub fn t(self, translate: Vector) -> Self
Translate.
pub fn s(self, scale: Vector) -> Self
[src]
pub fn s(self, scale: Vector) -> Self
Scale.
pub fn r(self, rotation: Rotation) -> Self
[src]
pub fn r(self, rotation: Rotation) -> Self
Rotate Quaternion (axis, angle).
pub fn m(self, matrix: Self) -> Self
[src]
pub fn m(self, matrix: Self) -> Self
Multiply by a custom matrix
pub fn new(
m00: f32,
m01: f32,
m02: f32,
m03: f32,
m10: f32,
m11: f32,
m12: f32,
m13: f32,
m20: f32,
m21: f32,
m22: f32,
m23: f32,
m30: f32,
m31: f32,
m32: f32,
m33: f32
) -> Self
[src]
pub fn new(
m00: f32,
m01: f32,
m02: f32,
m03: f32,
m10: f32,
m11: f32,
m12: f32,
m13: f32,
m20: f32,
m21: f32,
m22: f32,
m23: f32,
m30: f32,
m31: f32,
m32: f32,
m33: f32
) -> Self
Full constructor.
pub fn diagonal(di: f32) -> Self
[src]
pub fn diagonal(di: f32) -> Self
Diagonal constructor.
pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Self
[src]
pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Self
Tri-diagonal constructor.
pub fn orthographic_projection(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Self
[src]
pub fn orthographic_projection(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Self
Orthographic projection matrix constructor.
pub fn finite_perspective_projection(
fovy: f32,
aspect: f32,
near: f32,
far: f32
) -> Self
[src]
pub fn finite_perspective_projection(
fovy: f32,
aspect: f32,
near: f32,
far: f32
) -> Self
Finite perspective projection matrix constructor.
pub fn determinant(self) -> f32
[src]
pub fn determinant(self) -> f32
Computes the matrix determinant.
pub fn trace(self) -> f32
[src]
pub fn trace(self) -> f32
Computes the matrix trace.
pub fn inverse(self) -> Matrix
[src]
pub fn inverse(self) -> Matrix
Computes the matrix inverse.
Panics
Panics if the matrix has no inverse (i.e. has zero determinant).
pub fn transpose(self) -> Matrix
[src]
pub fn transpose(self) -> Matrix
Returns the matrix transpose.
pub fn try_invert(self) -> Option<Matrix>
[src]
pub fn try_invert(self) -> Option<Matrix>
Attempts to compute the matrix inverse, returning None
if the matrix is
non-invertible (i.e. has zero determinant).
Trait Implementations
impl Clone for Matrix
[src]
impl Clone for Matrix
fn clone(&self) -> Matrix
[src]
fn clone(&self) -> Matrix
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Matrix
[src]
impl Copy for Matrix
impl Debug for Matrix
[src]
impl Debug for Matrix
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Matrix
[src]
impl PartialEq for Matrix
fn eq(&self, other: &Matrix) -> bool
[src]
fn eq(&self, other: &Matrix) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Matrix) -> bool
[src]
fn ne(&self, other: &Matrix) -> bool
This method tests for !=
.
impl Display for Matrix
[src]
impl Display for Matrix
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Add<Matrix> for Matrix
[src]
impl Add<Matrix> for Matrix
type Output = Matrix
The resulting type after applying the +
operator.
fn add(self, rhs: Matrix) -> Self::Output
[src]
fn add(self, rhs: Matrix) -> Self::Output
Performs the +
operation.
impl Sub<Matrix> for Matrix
[src]
impl Sub<Matrix> for Matrix
type Output = Matrix
The resulting type after applying the -
operator.
fn sub(self, rhs: Matrix) -> Self::Output
[src]
fn sub(self, rhs: Matrix) -> Self::Output
Performs the -
operation.
impl Mul<f32> for Matrix
[src]
impl Mul<f32> for Matrix
type Output = Matrix
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Self::Output
[src]
fn mul(self, rhs: f32) -> Self::Output
Performs the *
operation.
impl Mul<(Vector, f32)> for Matrix
[src]
impl Mul<(Vector, f32)> for Matrix
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, rhs: (Vector, f32)) -> Self::Output
[src]
fn mul(self, rhs: (Vector, f32)) -> Self::Output
Performs the *
operation.
impl<'a> Mul<(Vector, f32)> for &'a Matrix
[src]
impl<'a> Mul<(Vector, f32)> for &'a Matrix
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, rhs: (Vector, f32)) -> Self::Output
[src]
fn mul(self, rhs: (Vector, f32)) -> Self::Output
Performs the *
operation.
impl Mul<Matrix> for f32
[src]
impl Mul<Matrix> for f32
type Output = Matrix
The resulting type after applying the *
operator.
fn mul(self, rhs: Matrix) -> Self::Output
[src]
fn mul(self, rhs: Matrix) -> Self::Output
Performs the *
operation.
impl Mul<Matrix> for Matrix
[src]
impl Mul<Matrix> for Matrix
type Output = Matrix
The resulting type after applying the *
operator.
fn mul(self, rhs: Matrix) -> Self::Output
[src]
fn mul(self, rhs: Matrix) -> Self::Output
Performs the *
operation.
impl Default for Matrix
[src]
impl Default for Matrix
impl AsRef<[[f32; 4]; 4]> for Matrix
[src]
impl AsRef<[[f32; 4]; 4]> for Matrix
impl From<[[f32; 4]; 4]> for Matrix
[src]
impl From<[[f32; 4]; 4]> for Matrix
impl Into<[[f32; 4]; 4]> for Matrix
[src]
impl Into<[[f32; 4]; 4]> for Matrix
impl From<f32> for Matrix
[src]
impl From<f32> for Matrix
impl Into<[f32; 16]> for Matrix
[src]
impl Into<[f32; 16]> for Matrix