Struct spectra::linear::Matrix4 [] [src]

#[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

The first column of the matrix.

The second column of the matrix.

The third column of the matrix.

The fourth column of the matrix.

Methods

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

[src]

Create a new matrix, providing values for each index.

[src]

Create a new matrix, providing columns.

[src]

Create a homogeneous transformation matrix from a translation vector.

[src]

Create a homogeneous transformation matrix from a scale value.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[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.

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

[src]

Component-wise casting to another type

Trait Implementations

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

The column vector of the matrix.

The row vector of the matrix.

The result of transposing the matrix

[src]

Get a row from this matrix by-value.

[src]

Swap two rows of this array.

[src]

Swap two columns of this array.

[src]

Swap the values at index a and b

[src]

Transpose this matrix, returning a new matrix.

[src]

Get the pointer to the first element of the array.

[src]

Get a mutable pointer to the first element of the array.

[src]

Replace a column in the array.

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

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

[src]

Performs the += operation.

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

Used for specifying relative comparisons.

[src]

The default tolerance to use when testing values that are close together. Read more

[src]

The default relative tolerance for testing values that are far-apart. Read more

[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

[src]

A test for equality that uses a relative comparison if the values are far apart.

[src]

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

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

[src]

Performs the mutable indexing (container[index]) operation.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

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

[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

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

The associated scalar.

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

[src]

Performs the *= operation.

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

[src]

Performs the -= operation.

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

[src]

Create an identity transformation. That is, a transformation which does nothing. Read more

[src]

Create a transformation that rotates a vector to look at center from eye, using up for orientation. Read more

[src]

Transform a vector using this transform.

[src]

Transform a point using this transform.

[src]

Combine this transform with another, yielding a new transformation which has the effects of both. Read more

[src]

Create a transform that "un-does" this one.

[src]

Combine this transform with another, in-place.

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

[src]

Performs the %= operation.

impl<'a> Mul<&'a Matrix4<i64>> for i64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<u64>> for u64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<usize>> for usize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<isize>> for isize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<u16>> for u16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<f64>> for f64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<i64>> for i64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<u16>> for u16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<f32>> for f32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<usize>> for usize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<u8>> for u8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<i32>> for i32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<f64>> for f64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<i16>> for i16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<i16>> for i16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<i32>> for i32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<i8>> for i8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<u8>> for u8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<u32>> for u32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<u64>> for u64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<i8>> for i8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Matrix4<isize>> for isize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Matrix4<u32>> for u32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Performs the /= operation.

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

The row/column vector of the matrix. Read more

[src]

Create a new diagonal matrix using the supplied value.

[src]

Create a matrix from a non-uniform scale

[src]

Transpose this matrix in-place.

[src]

Take the determinant of this matrix.

[src]

Return a vector containing the diagonal of this matrix.

[src]

Invert this matrix, returning a new matrix. m.mul_m(m.invert()) is the identity matrix. Returns None if this matrix is not invertible (has a determinant of zero). Read more

[src]

Test if this is a diagonal matrix. That is, every element outside of the diagonal is 0. Read more

[src]

Test if this matrix is symmetric. That is, it is equal to its transpose. Read more

[src]

The [identity matrix]. Multiplying this matrix with another should have no effect. Read more

[src]

Return the trace of this matrix. That is, the sum of the diagonal.

[src]

Test if this matrix is invertible.

[src]

Test if this matrix is the identity matrix. That is, it is diagonal and every element in the diagonal is one. Read more

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

[src]

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

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

[src]

Convert the quaternion to a 4 x 4 rotation matrix.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

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

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl<'a> Div<&'a Matrix4<u16>> for u16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<f32>> for f32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<i32>> for i32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<u16>> for u16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<u8>> for u8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<i32>> for i32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<i64>> for i64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<u64>> for u64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<isize>> for isize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<isize>> for isize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<u32>> for u32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<i8>> for i8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<i64>> for i64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<u64>> for u64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<f64>> for f64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<usize>> for usize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<u8>> for u8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<f64>> for f64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<i8>> for i8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Matrix4<i16>> for i16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<u32>> for u32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<f32>> for f32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<usize>> for usize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Matrix4<i16>> for i16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

[src]

Generates a random instance of this type using the specified source of randomness. Read more

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Returns the multiplicative identity element of Self, 1. Read more

[src]

Returns true if self is equal to the multiplicative identity. Read more

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

[src]

Returns the additive identity element of Self, 0. Read more

[src]

Returns true if self is equal to the additive identity.

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

[src]

Performs the conversion.

impl<'a> Rem<&'a Matrix4<u8>> for u8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<f64>> for f64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<i8>> for i8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<i64>> for i64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<u32>> for u32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<u8>> for u8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<isize>> for isize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<u32>> for u32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<i32>> for i32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<u16>> for u16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<i64>> for i64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<usize>> for usize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<f32>> for f32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<i8>> for i8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<usize>> for usize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<u64>> for u64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<i16>> for i16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<u16>> for u16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<f32>> for f32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<u64>> for u64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<isize>> for isize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<f64>> for f64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Matrix4<i32>> for i32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Matrix4<i16>> for i16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

[src]

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

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

[src]

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

Auto Trait Implementations

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

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