[][src]Struct plop::prelude::Matrix

#[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: f32m01: f32m02: f32m03: f32m10: f32m11: f32m12: f32m13: f32m20: f32m21: f32m22: f32m23: f32m30: f32m31: f32m32: f32m33: f32

Methods

impl Matrix[src]

pub fn srt(self, scale: Vector, rotate: Rotation, translate: Vector) -> Matrix[src]

Scale, then rotate Quaternion (axis, angle), then translate.

pub fn rt(self, rotate: Rotation, translate: Vector) -> Matrix[src]

Rotate Quaternion (axis, angle), then translate.

pub fn st(self, scale: Vector, translate: Vector) -> Matrix[src]

Scale, then translate.

pub fn t(self, translate: Vector) -> Matrix[src]

Translate.

pub fn s(self, scale: Vector) -> Matrix[src]

Scale.

pub fn r(self, rotation: Rotation) -> Matrix[src]

Rotate Quaternion (axis, angle).

pub fn m(self, matrix: Matrix) -> Matrix[src]

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
) -> Matrix
[src]

Full constructor.

pub fn diagonal(di: f32) -> Matrix[src]

Diagonal constructor.

pub fn tridiagonal(lo: f32, di: f32, up: f32) -> Matrix[src]

Tri-diagonal constructor.

pub fn orthographic_projection(
    left: f32,
    right: f32,
    bottom: f32,
    top: f32,
    near: f32,
    far: f32
) -> Matrix
[src]

Orthographic projection matrix constructor.

pub fn finite_perspective_projection(
    fovy: f32,
    aspect: f32,
    near: f32,
    far: f32
) -> Matrix
[src]

Finite perspective projection matrix constructor.

pub fn determinant(self) -> f32[src]

Computes the matrix determinant.

pub fn trace(self) -> f32[src]

Computes the matrix trace.

pub fn inverse(self) -> Matrix[src]

Computes the matrix inverse.

Panics

Panics if the matrix has no inverse (i.e. has zero determinant).

pub fn transpose(self) -> Matrix[src]

Returns the matrix transpose.

pub fn try_invert(self) -> Option<Matrix>[src]

Attempts to compute the matrix inverse, returning None if the matrix is non-invertible (i.e. has zero determinant).

Trait Implementations

impl Copy for Matrix[src]

impl Clone for Matrix[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Add<Matrix> for Matrix[src]

type Output = Matrix

The resulting type after applying the + operator.

impl AsRef<[[f32; 4]; 4]> for Matrix[src]

impl Sub<Matrix> for Matrix[src]

type Output = Matrix

The resulting type after applying the - operator.

impl From<[[f32; 4]; 4]> for Matrix[src]

impl From<f32> for Matrix[src]

impl Debug for Matrix[src]

impl Into<[f32; 16]> for Matrix[src]

impl Into<[[f32; 4]; 4]> for Matrix[src]

impl<'a> Mul<(Vector, f32)> for &'a Matrix[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<f32> for Matrix[src]

type Output = Matrix

The resulting type after applying the * operator.

impl Mul<(Vector, f32)> for Matrix[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<Matrix> for Matrix[src]

type Output = Matrix

The resulting type after applying the * operator.

impl Default for Matrix[src]

impl PartialEq<Matrix> for Matrix[src]

impl Display for Matrix[src]

Auto Trait Implementations

impl Send for Matrix

impl Sync for Matrix

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]