[][src]Struct nannou::math::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> Matrix4<S>[src]

pub const 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
) -> Matrix4<S>
[src]

Create a new matrix, providing values for each index.

pub const fn from_cols(
    c0: Vector4<S>,
    c1: Vector4<S>,
    c2: Vector4<S>,
    c3: Vector4<S>
) -> Matrix4<S>
[src]

Create a new matrix, providing columns.

impl<S> Matrix4<S> where
    S: BaseFloat
[src]

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

Create a homogeneous transformation matrix from a translation vector.

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.

pub fn look_at_dir(
    eye: Point3<S>,
    dir: Vector3<S>,
    up: Vector3<S>
) -> Matrix4<S>
[src]

Create a homogeneous transformation matrix that will cause a vector to point at dir, using up for orientation.

pub fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>[src]

Create a homogeneous transformation matrix that will cause a vector to point at center, using up for orientation.

pub fn from_angle_x<A>(theta: A) -> Matrix4<S> where
    A: Into<Rad<S>>, 
[src]

Create a homogeneous transformation matrix from a rotation around the x axis (pitch).

pub fn from_angle_y<A>(theta: A) -> Matrix4<S> where
    A: Into<Rad<S>>, 
[src]

Create a homogeneous transformation matrix from a rotation around the y axis (yaw).

pub fn from_angle_z<A>(theta: A) -> Matrix4<S> where
    A: Into<Rad<S>>, 
[src]

Create a homogeneous transformation matrix from a rotation around the z axis (roll).

pub fn from_axis_angle<A>(axis: Vector3<S>, angle: A) -> Matrix4<S> where
    A: Into<Rad<S>>, 
[src]

Create a homogeneous transformation matrix from an angle around an arbitrary axis.

The specified axis must be normalized, or it represents an invalid rotation.

pub fn is_finite(&self) -> bool[src]

Are all entries in the matrix finite.

impl<S> Matrix4<S> where
    S: Copy + NumCast
[src]

pub fn cast<T>(&self) -> Option<Matrix4<T>> where
    T: NumCast
[src]

Component-wise casting to another type

Trait Implementations

impl<S> AbsDiffEq<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Epsilon = <S as AbsDiffEq<S>>::Epsilon

Used for specifying relative comparisons.

impl<'a, S> Add<&'a Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the + operator.

impl<'a, 'b, S> Add<&'a Matrix4<S>> for &'b Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the + operator.

impl<S> Add<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the + operator.

impl<'a, S> Add<Matrix4<S>> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the + operator.

impl<S> AddAssign<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat + AddAssign<S>, 
[src]

impl<S> AsMut<[[S; 4]; 4]> for Matrix4<S>[src]

impl<S> AsMut<[S; 16]> for Matrix4<S>[src]

impl<S> AsRef<[[S; 4]; 4]> for Matrix4<S>[src]

impl<S> AsRef<[S; 16]> for Matrix4<S>[src]

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

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

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

impl<'de, S> Deserialize<'de> for Matrix4<S> where
    S: Deserialize<'de>, 
[src]

impl<'a, S> Div<S> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the / operator.

impl<S> Div<S> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the / operator.

impl<S> DivAssign<S> for Matrix4<S> where
    S: BaseFloat + DivAssign<S>, 
[src]

impl<'a, S> From<&'a [[S; 4]; 4]> for &'a Matrix4<S>[src]

impl<'a, S> From<&'a [S; 16]> for &'a Matrix4<S>[src]

impl<'a, S> From<&'a mut [[S; 4]; 4]> for &'a mut Matrix4<S>[src]

impl<'a, S> From<&'a mut [S; 16]> for &'a mut Matrix4<S>[src]

impl<S> From<[[S; 4]; 4]> for Matrix4<S> where
    S: Copy
[src]

impl<S, R> From<Decomposed<Vector3<S>, R>> for Matrix4<S> where
    R: Rotation3<S>,
    S: BaseFloat
[src]

impl<A> From<Euler<A>> for Matrix4<<A as Angle>::Unitless> where
    A: Angle + Into<Rad<<A as Angle>::Unitless>>, 
[src]

impl<S> From<Matrix2<S>> for Matrix4<S> where
    S: BaseFloat
[src]

fn from(m: Matrix2<S>) -> Matrix4<S>[src]

Clone the elements of a 2-dimensional matrix into the top-left corner of a 4-dimensional identity matrix.

impl<S> From<Matrix3<S>> for Matrix4<S> where
    S: BaseFloat
[src]

fn from(m: Matrix3<S>) -> Matrix4<S>[src]

Clone the elements of a 3-dimensional matrix into the top-left corner of a 4-dimensional identity matrix.

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

impl<S> From<Perspective<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> From<PerspectiveFov<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> From<Quaternion<S>> for Matrix4<S> where
    S: BaseFloat
[src]

fn from(quat: Quaternion<S>) -> Matrix4<S>[src]

Convert the quaternion to a 4 x 4 rotation matrix.

impl<S> Index<usize> for Matrix4<S>[src]

type Output = Vector4<S>

The returned type after indexing.

impl<S> IndexMut<usize> for Matrix4<S>[src]

impl<S> Into<[[S; 4]; 4]> for Matrix4<S>[src]

impl<S> Matrix for Matrix4<S> where
    S: BaseFloat
[src]

type Column = Vector4<S>

The column vector of the matrix.

type Row = Vector4<S>

The row vector of the matrix.

type Transpose = Matrix4<S>

The result of transposing the matrix

impl<'a, S> Mul<&'a Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<'a, 'b, S> Mul<&'a Matrix4<S>> for &'b Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<&'a Vector4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Vector4<S>

The resulting type after applying the * operator.

impl<'a, 'b, S> Mul<&'a Vector4<S>> for &'b Matrix4<S> where
    S: BaseFloat
[src]

type Output = Vector4<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<Matrix4<S>> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<S> Mul<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<S> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<S> Mul<S> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the * operator.

impl<'a, S> Mul<Vector4<S>> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Vector4<S>

The resulting type after applying the * operator.

impl<S> Mul<Vector4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Vector4<S>

The resulting type after applying the * operator.

impl<S> MulAssign<S> for Matrix4<S> where
    S: BaseFloat + MulAssign<S>, 
[src]

impl<S> Neg for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<'a, S> Neg for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<S> One for Matrix4<S> where
    S: BaseFloat
[src]

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

impl<'a, S> Product<&'a Matrix4<S>> for Matrix4<S> where
    S: 'a + BaseFloat
[src]

impl<S> Product<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> RelativeEq<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> Rem<S> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the % operator.

impl<'a, S> Rem<S> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the % operator.

impl<S> RemAssign<S> for Matrix4<S> where
    S: BaseFloat + RemAssign<S>, 
[src]

impl<S> Serialize for Matrix4<S> where
    S: Serialize
[src]

impl<S> SquareMatrix for Matrix4<S> where
    S: BaseFloat
[src]

type ColumnRow = Vector4<S>

The row/column vector of the matrix. Read more

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

impl<'a, 'b, S> Sub<&'a Matrix4<S>> for &'b Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<'a, S> Sub<&'a Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<S> Sub<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<'a, S> Sub<Matrix4<S>> for &'a Matrix4<S> where
    S: BaseFloat
[src]

type Output = Matrix4<S>

The resulting type after applying the - operator.

impl<S> SubAssign<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat + SubAssign<S>, 
[src]

impl<'a, S> Sum<&'a Matrix4<S>> for Matrix4<S> where
    S: 'a + BaseFloat
[src]

impl<S> Sum<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> Transform<Point3<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> Transform3<S> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> UlpsEq<Matrix4<S>> for Matrix4<S> where
    S: BaseFloat
[src]

impl<S> VectorSpace for Matrix4<S> where
    S: BaseFloat
[src]

type Scalar = S

The associated scalar.

impl<S> Zero for Matrix4<S> where
    S: BaseFloat
[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<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> One for T where
    T: One

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T> Style for T where
    T: Any + Debug + PartialEq<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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Zero for T where
    T: Zero