[][src]Struct rgx::math::algebra::Matrix4

#[repr(C)]
pub struct Matrix4<S> {
    pub x: Vector4<S>,
    pub y: Vector4<S>,
    pub z: Vector4<S>,
    pub w: Vector4<S>,
}

A 4 x 4, column major matrix

This type is marked as #[repr(C)].

Fields

x: Vector4<S>

The first column of the matrix.

y: Vector4<S>

The second column of the matrix.

z: Vector4<S>

The third column of the matrix.

w: Vector4<S>

The fourth column of the matrix.

Methods

impl<S: Copy + Zero + One> Matrix4<S>[src]

pub fn new(
    c0r0: S,
    c0r1: S,
    c0r2: S,
    c0r3: S,
    c1r0: S,
    c1r1: S,
    c1r2: S,
    c1r3: S,
    c2r0: S,
    c2r1: S,
    c2r2: S,
    c2r3: S,
    c3r0: S,
    c3r1: S,
    c3r2: S,
    c3r3: S
) -> Self
[src]

Create a new matrix, providing values for each index.

pub fn identity() -> Self[src]

pub fn from_translation(v: Vector3<S>) -> Self[src]

Create a homogeneous transformation matrix from a translation vector.

pub fn row(&self, n: usize) -> Vector4<S>[src]

pub fn from_scale(value: S) -> Matrix4<S>[src]

Create a homogeneous transformation matrix from a scale value.

pub fn from_nonuniform_scale(x: S, y: S, z: S) -> Matrix4<S>[src]

Create a homogeneous transformation matrix from a set of scale values.

Trait Implementations

impl<S: Clone> Clone for Matrix4<S>[src]

impl<S: Copy> Copy for Matrix4<S>[src]

impl<S: Debug> Debug for Matrix4<S>[src]

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

impl<S: Float> From<Ortho<S>> for Matrix4<S>[src]

impl<S> Mul<Matrix4<S>> for Matrix4<S> where
    S: Mul<Output = S> + Add<Output = S> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Point2<f32>> for Matrix4<f32>[src]

Transform a Point2 with a Matrix4.

use rgx::math::*;
let m = Matrix4::from_translation(Vector3::new(8., 8., 0.));
let p = Point2::new(1., 1.);

assert_eq!(m * p, Point2::new(9., 9.));

type Output = Point2<f32>

The resulting type after applying the * operator.

impl Mul<Vector3<f32>> for Matrix4<f32>[src]

Transform a Vector3 with a Matrix4.

use rgx::math::*;
let m = Matrix4::from_translation(Vector3::new(8., 8., 0.));
let v = Vector3::new(1., 1., 0.);

assert_eq!(m * v, Vector3::new(9., 9., 0.));

type Output = Vector3<f32>

The resulting type after applying the * operator.

impl<S: PartialEq> PartialEq<Matrix4<S>> for Matrix4<S>[src]

impl<S> StructuralPartialEq for Matrix4<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Matrix4<S> where
    S: RefUnwindSafe

impl<S> Send for Matrix4<S> where
    S: Send

impl<S> Sync for Matrix4<S> where
    S: Sync

impl<S> Unpin for Matrix4<S> where
    S: Unpin

impl<S> UnwindSafe for Matrix4<S> where
    S: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> 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, 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.