Struct nalgebra::Mat4 [] [src]

pub struct Mat4<N> {
    pub m11: N,
    pub m21: N,
    pub m31: N,
    pub m41: N,
    pub m12: N,
    pub m22: N,
    pub m32: N,
    pub m42: N,
    pub m13: N,
    pub m23: N,
    pub m33: N,
    pub m43: N,
    pub m14: N,
    pub m24: N,
    pub m34: N,
    pub m44: N,
}

Square matrix of dimension 4.

Fields

m11: N m21: N m31: N m41: N m12: N m22: N m32: N m42: N m13: N m23: N m33: N m43: N m14: N m24: N m34: N m44: N

Methods

impl<N> Mat4<N>
[src]

fn new(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N, m41: N, m42: N, m43: N, m44: N) -> Mat4<N>

impl<N> Mat4<N>
[src]

fn as_array(&self) -> &[[N; 4]; 4]

View this matrix as a column-major array of arrays.

fn as_array_mut<'a>(&'a mut self) -> &'a mut [[N; 4]; 4]

View this matrix as a column-major mutable array of arrays.

fn from_array_ref(array: &[[N; 4]; 4]) -> &Mat4<N>

View a column-major array of array as a vector.

fn from_array_mut(array: &mut [[N; 4]; 4]) -> &mut Mat4<N>

View a column-major array of array as a mutable vector.

impl<N: Copy> Mat4<N>
[src]

unsafe fn at_fast(&self, (i, j): (usize, usize)) -> N

unsafe fn set_fast(&mut self, (i, j): (usize, usize), val: N)

Trait Implementations

impl<N: Copy> Copy for Mat4<N>
[src]

impl<N: Debug> Debug for Mat4<N>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<N: Hash> Hash for Mat4<N>
[src]

fn hash<__HN: Hasher>(&self, __arg_0: &mut __HN)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl<N: Clone> Clone for Mat4<N>
[src]

fn clone(&self) -> Mat4<N>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<N: Decodable> Decodable for Mat4<N>
[src]

fn decode<__DN: Decoder>(__arg_0: &mut __DN) -> Result<Mat4<N>, __DN::Error>

impl<N: Encodable> Encodable for Mat4<N>
[src]

fn encode<__SN: Encoder>(&self, __arg_0: &mut __SN) -> Result<(), __SN::Error>

impl<N: PartialEq> PartialEq for Mat4<N>
[src]

fn eq(&self, __arg_0: &Mat4<N>) -> bool

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

fn ne(&self, __arg_0: &Mat4<N>) -> bool

This method tests for !=.

impl<N: Eq> Eq for Mat4<N>
[src]

impl<N: Zero + One> Eye for Mat4<N>
[src]

fn new_identity(dim: usize) -> Mat4<N>

Return the identity matrix of specified dimension

impl<N: Copy> Repeat<N> for Mat4<N>
[src]

fn repeat(val: N) -> Mat4<N>

Returns a value with filled by val.

impl<Nin: Copy, Nout: Copy + Cast<Nin>> Cast<Mat4<Nin>> for Mat4<Nout>
[src]

fn from(v: Mat4<Nin>) -> Mat4<Nout>

Converts an element of type T to an element of type Self.

impl<N: Add<N, Output=N>> Add<Mat4<N>> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the + operator

fn add(self, right: Mat4<N>) -> Mat4<N>

The method for the + operator

impl<N: Sub<N, Output=N>> Sub<Mat4<N>> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the - operator

fn sub(self, right: Mat4<N>) -> Mat4<N>

The method for the - operator

impl<N: Copy + Add<N, Output=N>> Add<N> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the + operator

fn add(self, right: N) -> Mat4<N>

The method for the + operator

impl<N: Copy + Sub<N, Output=N>> Sub<N> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the - operator

fn sub(self, right: N) -> Mat4<N>

The method for the - operator

impl<N: Copy + Mul<N, Output=N>> Mul<N> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the * operator

fn mul(self, right: N) -> Mat4<N>

The method for the * operator

impl<N: Copy + Div<N, Output=N>> Div<N> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the / operator

fn div(self, right: N) -> Mat4<N>

The method for the / operator

impl<N: Absolute<N>> Absolute<Mat4<N>> for Mat4<N>
[src]

fn abs(m: &Mat4<N>) -> Mat4<N>

Computes some absolute value of this object. Typically, this will make all component of a matrix or vector positive. Read more

impl<N: Zero> Zero for Mat4<N>
[src]

fn zero() -> Mat4<N>

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

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.

impl<N: Copy + BaseNum> One for Mat4<N>
[src]

fn one() -> Mat4<N>

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

impl<N> Iterable<N> for Mat4<N>
[src]

fn iter<'l>(&'l self) -> Iter<'l, N>

Gets a vector-like read-only iterator.

impl<N> IterableMut<N> for Mat4<N>
[src]

fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N>

Gets a vector-like read-write iterator.

impl<N> Dim for Mat4<N>
[src]

fn dim(_: Option<Mat4<N>>) -> usize

The dimension of the object.

impl<N> Shape<(usize, usize)> for Mat4<N>
[src]

fn shape(&self) -> (usize, usize)

Returns the shape of an indexable object.

impl<N: Copy> Indexable<(usize, usize), N> for Mat4<N>
[src]

fn swap(&mut self, (i1, j1): (usize, usize), (i2, j2): (usize, usize))

Swaps the i-th element of self with its j-th element.

unsafe fn unsafe_at(&self, (i, j): (usize, usize)) -> N

Reads the i-th element of self. Read more

unsafe fn unsafe_set(&mut self, (i, j): (usize, usize), val: N)

Writes to the i-th element of self. Read more

impl<N> Index<(usize, usize)> for Mat4<N>
[src]

type Output = N

The returned type after indexing

fn index(&self, (i, j): (usize, usize)) -> &N

The method for the indexing (Foo[Bar]) operation

impl<N> IndexMut<(usize, usize)> for Mat4<N>
[src]

fn index_mut(&mut self, (i, j): (usize, usize)) -> &mut N

The method for the indexing (Foo[Bar]) operation

impl<N: Copy + BaseNum> Mul<Mat4<N>> for Mat4<N>
[src]

type Output = Mat4<N>

The resulting type after applying the * operator

fn mul(self, right: Mat4<N>) -> Mat4<N>

The method for the * operator

impl<N: Copy + BaseNum> Mul<Vec4<N>> for Mat4<N>
[src]

type Output = Vec4<N>

The resulting type after applying the * operator

fn mul(self, right: Vec4<N>) -> Vec4<N>

The method for the * operator

impl<N: Copy + BaseNum> Mul<Pnt4<N>> for Mat4<N>
[src]

type Output = Pnt4<N>

The resulting type after applying the * operator

fn mul(self, right: Pnt4<N>) -> Pnt4<N>

The method for the * operator

impl<N: Copy + BaseNum> Inv for Mat4<N>
[src]

fn inv(&self) -> Option<Mat4<N>>

Returns the inverse of m.

fn inv_mut(&mut self) -> bool

In-place version of inverse.

impl<N: Copy> Transpose for Mat4<N>
[src]

fn transpose(&self) -> Mat4<N>

Computes the transpose of a matrix.

fn transpose_mut(&mut self)

In-place version of transposed.

impl<N: ApproxEq<N>> ApproxEq<N> for Mat4<N>
[src]

fn approx_epsilon(_: Option<Mat4<N>>) -> N

Default epsilon for approximation.

fn approx_ulps(_: Option<Mat4<N>>) -> u32

Default ULPs for approximation.

fn approx_eq_eps(&self, other: &Mat4<N>, epsilon: &N) -> bool

Tests approximate equality using a custom epsilon.

fn approx_eq_ulps(&self, other: &Mat4<N>, ulps: u32) -> bool

Tests approximate equality using units in the last place (ULPs)

fn approx_eq(&self, other: &Self) -> bool

Tests approximate equality.

impl<N: Copy + Zero> Row<Vec4<N>> for Mat4<N>
[src]

fn nrows(&self) -> usize

The number of column of self.

fn set_row(&mut self, row: usize, v: Vec4<N>)

Writes the i-th row of self.

fn row(&self, row: usize) -> Vec4<N>

Reads the i-th row of self.

impl<N: Copy + Zero> Col<Vec4<N>> for Mat4<N>
[src]

fn ncols(&self) -> usize

The number of column of this matrix or vector.

fn set_col(&mut self, col: usize, v: Vec4<N>)

Writes the i-th column of self.

fn col(&self, col: usize) -> Vec4<N>

Reads the i-th column of self.

impl<N: Clone + Copy + Zero> ColSlice<DVec4<N>> for Mat4<N>
[src]

fn col_slice(&self, cid: usize, rstart: usize, rend: usize) -> DVec4<N>

Returns a view to a slice of a column of a matrix.

impl<N: Clone + Copy + Zero> RowSlice<DVec4<N>> for Mat4<N>
[src]

fn row_slice(&self, rid: usize, cstart: usize, cend: usize) -> DVec4<N>

Returns a view to a slice of a row of a matrix.

impl<N: Copy + Zero> Diag<Vec4<N>> for Mat4<N>
[src]

fn from_diag(diag: &Vec4<N>) -> Mat4<N>

Creates a new matrix with the given diagonal.

fn diag(&self) -> Vec4<N>

The diagonal of this matrix.

impl<N: BaseNum + Copy> ToHomogeneous<Mat5<N>> for Mat4<N>
[src]

fn to_homogeneous(&self) -> Mat5<N>

Gets the homogeneous coordinates form of this object.

impl<N: BaseNum + Copy> FromHomogeneous<Mat5<N>> for Mat4<N>
[src]

fn from(m: &Mat5<N>) -> Mat4<N>

Builds an object from its homogeneous coordinate form. Read more

impl<N> EigenQR<N, Vec4<N>> for Mat4<N> where N: BaseFloat + ApproxEq<N> + Clone
[src]

fn eigen_qr(&self, eps: &N, niter: usize) -> (Mat4<N>, Vec4<N>)

Computes the eigenvectors and eigenvalues of this matrix.

impl<N: Rand> Rand for Mat4<N>
[src]

fn rand<R: Rng>(rng: &mut R) -> Mat4<N>

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