Struct cgmath::Matrix4 [] [src]

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

Fields

x
y
z
w

Methods

impl<S> Matrix4<S>

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

Create a new matrix, providing values for each index.

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

Create a new matrix, providing columns.

impl<S: BaseNum> Matrix4<S>

fn from_value(value: S) -> Matrix4<S>[]

Create a new diagonal matrix, providing a single value to use for each non-zero index.

fn zero() -> Matrix4<S>[]

Create a zero matrix (all zeros).

fn identity() -> Matrix4<S>[]

Create an identity matrix (diagonal matrix of ones).

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

Create a translation matrix from a Vector3

impl<S: BaseFloat> Matrix4<S>

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

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

impl<S: Copy + Neg<Output=S>> Matrix4<S>

fn neg_self(&mut self)[]

Negate this Matrix4 in-place.

Trait Implementations

impl<S: BaseFloat> Add for Matrix4<S>

type Output = Matrix4<S>

fn add(self, other: Matrix4<S>) -> Matrix4<S>

impl<S: BaseFloat> Sub for Matrix4<S>

type Output = Matrix4<S>

fn sub(self, other: Matrix4<S>) -> Matrix4<S>

impl<S: Neg<Output=S>> Neg for Matrix4<S>

type Output = Matrix4<S>

fn neg(self) -> Matrix4<S>

impl<S: BaseFloat> Zero for Matrix4<S>

fn zero() -> Matrix4<S>

fn is_zero(&self) -> bool

impl<S: BaseFloat> Mul for Matrix4<S>

type Output = Matrix4<S>

fn mul(self, other: Matrix4<S>) -> Matrix4<S>

impl<S: BaseFloat> Mul<S> for Matrix4<S>

type Output = Matrix4<S>

fn mul(self, other: S) -> Matrix4<S>

impl<S: BaseFloat> One for Matrix4<S>

fn one() -> Matrix4<S>

impl<S> FixedArray<[[S; 4]; 4]> for Matrix4<S>

fn into_fixed(self) -> [[S; 4]; 4]

fn as_fixed<'a>(&'a self) -> &'a [[S; 4]; 4]

fn as_mut_fixed<'a>(&'a mut self) -> &'a mut [[S; 4]; 4]

fn from_fixed(_v: [[S; 4]; 4]) -> Matrix4<S>

fn from_fixed_ref<'a>(v: &'a [[S; 4]; 4]) -> &'a Matrix4<S>

fn from_fixed_mut<'a>(v: &'a mut [[S; 4]; 4]) -> &'a mut Matrix4<S>

impl<S> Index<usize> for Matrix4<S>

type Output = Vector4<S>

fn index<'a>(&'a self, i: usize) -> &'a Vector4<S>

impl<S> IndexMut<usize> for Matrix4<S>

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut Vector4<S>

impl<S: Copy + 'static> Array2<Vector4<S>, Vector4<S>, S> for Matrix4<S>

fn row(&self, r: usize) -> Vector4<S>

fn swap_rows(&mut self, a: usize, b: usize)

fn map<F>(&mut self, op: F) -> Matrix4<S> where F: FnMut(&Vector4<S>) -> Vector4<S>

fn ptr<'a>(&'a self) -> &'a Element

fn mut_ptr<'a>(&'a mut self) -> &'a mut Element

fn swap_cols(&mut self, a: usize, b: usize)

fn replace_col(&mut self, c: usize, src: Column) -> Column

fn swap_elems(&mut self, a: (usize, usize), b: (usize, usize))

impl<S: BaseFloat> Matrix<S, Vector4<S>> for Matrix4<S>

fn mul_s(&self, s: S) -> Matrix4<S>

fn div_s(&self, s: S) -> Matrix4<S>

fn rem_s(&self, s: S) -> Matrix4<S>

fn add_m(&self, m: &Matrix4<S>) -> Matrix4<S>

fn sub_m(&self, m: &Matrix4<S>) -> Matrix4<S>

fn mul_v(&self, v: &Vector4<S>) -> Vector4<S>

fn mul_m(&self, other: &Matrix4<S>) -> Matrix4<S>

fn mul_self_s(&mut self, s: S)

fn div_self_s(&mut self, s: S)

fn rem_self_s(&mut self, s: S)

fn add_self_m(&mut self, m: &Matrix4<S>)

fn sub_self_m(&mut self, m: &Matrix4<S>)

fn transpose(&self) -> Matrix4<S>

fn transpose_self(&mut self)

fn determinant(&self) -> S

fn diagonal(&self) -> Vector4<S>

fn invert(&self) -> Option<Matrix4<S>>

fn is_diagonal(&self) -> bool

fn is_symmetric(&self) -> bool

fn mul_self_m(&mut self, m: &Self)

fn trace(&self) -> S

fn invert_self(&mut self)

fn is_invertible(&self) -> bool

fn is_identity(&self) -> bool

impl<S: BaseFloat> ApproxEq<S> for Matrix4<S>

fn approx_eq_eps(&self, other: &Matrix4<S>, epsilon: &S) -> bool

fn approx_epsilon(_hack: Option<Self>) -> T

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

impl<S: BaseFloat> From<Matrix2<S>> for Matrix4<S>

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

impl<S: BaseFloat> From<Matrix3<S>> for Matrix4<S>

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

impl<S: BaseNum> Debug for Matrix4<S>

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

impl<S: BaseFloat + Rand> Rand for Matrix4<S>

fn rand<R: Rng>(rng: &mut R) -> Matrix4<S>

impl<S: BaseFloat> From<Quaternion<S>> for Matrix4<S>

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

impl<S: BaseFloat + 'static, R: Rotation3<S>> From<Decomposed<S, Vector3<S>, R>> for Matrix4<S>

fn from(dec: Decomposed<S, Vector3<S>, R>) -> Matrix4<S>

impl<S: BaseNum> From<AffineMatrix3<S>> for Matrix4<S>

fn from(aff: AffineMatrix3<S>) -> Matrix4<S>

impl<S: BaseFloat, A: Angle<S>> From<PerspectiveFov<S, A>> for Matrix4<S>

fn from(persp: PerspectiveFov<S, A>) -> Matrix4<S>

impl<S: BaseFloat + 'static> From<Perspective<S>> for Matrix4<S>

fn from(persp: Perspective<S>) -> Matrix4<S>

impl<S: BaseFloat> From<Ortho<S>> for Matrix4<S>

fn from(ortho: Ortho<S>) -> Matrix4<S>

Derived Implementations

impl<S: Decodable> Decodable for Matrix4<S>

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Matrix4<S>, __D::Error>

impl<S: Encodable> Encodable for Matrix4<S>

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

impl<S: PartialEq> PartialEq for Matrix4<S>

fn eq(&self, __arg_0: &Matrix4<S>) -> bool

fn ne(&self, __arg_0: &Matrix4<S>) -> bool

impl<S: Clone> Clone for Matrix4<S>

fn clone(&self) -> Matrix4<S>

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

impl<S: Copy> Copy for Matrix4<S>