[][src]Struct mini_math::Matrix

#[repr(C)]
pub struct Matrix(pub [[f32; 4]; 4]);

A 4x4 matrix, suitable for 3D transformations.

Methods

impl Matrix[src]

pub fn identity() -> Self[src]

The identity matrix.

pub fn zero() -> Self[src]

A matrix composed entirely of zeroes.

pub fn look_at(eye: Point, target: Point, up: Vector) -> Self[src]

A look-at matrix suitable for positioning a camera.

pub fn perspective(
    aspect_ratio: f32,
    fov_radians: f32,
    znear: f32,
    zfar: f32
) -> Self
[src]

A perspective matrix suitable for use as a camera projection.

pub fn translation(v: Vector) -> Self[src]

A matrix that translates by the given vector.

pub fn rotation_x(angle_radians: f32) -> Self[src]

A matrix that rotates around the x-axis.

pub fn rotation_y(angle_radians: f32) -> Self[src]

A matrix that rotates around the y-axis.

pub fn rotation_z(angle_radians: f32) -> Self[src]

A matrix that rotates around the z-axis.

pub fn uniform_scale(scale: f32) -> Self[src]

A matrix that scales uniformly in all dimensions.

pub fn transpose(&self) -> Self[src]

The transpose of this matrix (i.e. this matrix flipped along the diagonal)

pub fn invert(&self) -> Self[src]

The inverse of this matrix.

Trait Implementations

impl<'_> NearlyEqual for &'_ Matrix[src]

impl Clone for Matrix[src]

impl Copy for Matrix[src]

impl PartialEq<Matrix> for Matrix[src]

impl Debug for Matrix[src]

impl<'_> Mul<&'_ Matrix> for Matrix[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Matrix> for Matrix[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Point> for Matrix[src]

type Output = Point

The resulting type after applying the * operator.

impl Mul<Vector> for Matrix[src]

type Output = Vector

The resulting type after applying the * operator.

impl StructuralPartialEq for Matrix[src]

impl AsBytes for Matrix[src]

impl FromBytes for Matrix[src]

Auto Trait Implementations

impl Send for Matrix

impl Sync for Matrix

impl Unpin for Matrix

impl UnwindSafe for Matrix

impl RefUnwindSafe for Matrix

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<T> for T where
    T: ?Sized
[src]

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

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