Struct cgmath::Matrix3 [] [src]

pub struct Matrix3<S> {
    pub x: Vector3<S>,
    pub y: Vector3<S>,
    pub z: Vector3<S>,
}

A 3 x 3, column major matrix

Fields

x
y
z

Methods

impl<S> Matrix3<S>

fn new(c0r0: S, c0r1: S, c0r2: S, c1r0: S, c1r1: S, c1r2: S, c2r0: S, c2r1: S, c2r2: S) -> Matrix3<S>

Create a new matrix, providing values for each index.

fn from_cols(c0: Vector3<S>, c1: Vector3<S>, c2: Vector3<S>) -> Matrix3<S>

Create a new matrix, providing columns.

impl<S: BaseNum> Matrix3<S>

fn from_value(value: S) -> Matrix3<S>

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

fn zero() -> Matrix3<S>

Create a zero matrix (all zeros).

fn identity() -> Matrix3<S>

Create an identity matrix (diagonal matrix of ones).

impl<S: BaseFloat> Matrix3<S>

fn look_at(dir: &Vector3<S>, up: &Vector3<S>) -> Matrix3<S>

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

fn from_angle_x(theta: Rad<S>) -> Matrix3<S>

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

fn from_angle_y(theta: Rad<S>) -> Matrix3<S>

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

fn from_angle_z(theta: Rad<S>) -> Matrix3<S>

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

fn from_euler(x: Rad<S>, y: Rad<S>, z: Rad<S>) -> Matrix3<S>

Create a matrix from a set of euler angles.

Parameters

  • x: the angular rotation around the x axis (pitch).
  • y: the angular rotation around the y axis (yaw).
  • z: the angular rotation around the z axis (roll).

fn from_axis_angle(axis: &Vector3<S>, angle: Rad<S>) -> Matrix3<S>

Create a matrix from a rotation around an arbitrary axis

fn from_diagonal(value: &Vector3<S>) -> Matrix3<S>

Create a matrix from a non-uniform scale

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

fn neg_self(&mut self)

Negate this Matrix3 in-place.

Trait Implementations

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

type Output = Matrix3<S>

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

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

type Output = Matrix3<S>

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

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

type Output = Matrix3<S>

fn neg(self) -> Matrix3<S>

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

fn zero() -> Matrix3<S>

fn is_zero(&self) -> bool

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

type Output = Matrix3<S>

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

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

type Output = Matrix3<S>

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

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

fn one() -> Matrix3<S>

impl<S> FixedArray<[[S; 3]; 3]> for Matrix3<S>

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

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

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

fn from_fixed(_v: [[S; 3]; 3]) -> Matrix3<S>

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

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

impl<S> Index<usize> for Matrix3<S>

type Output = Vector3<S>

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

impl<S> IndexMut<usize> for Matrix3<S>

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

impl<S: Copy + 'static> Array2<Vector3<S>, Vector3<S>, S> for Matrix3<S>

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

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

fn map<F>(&mut self, op: F) -> Matrix3<S> where F: FnMut(&Vector3<S>) -> Vector3<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, Vector3<S>> for Matrix3<S>

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

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

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

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

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

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

fn mul_m(&self, other: &Matrix3<S>) -> Matrix3<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: &Matrix3<S>)

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

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

fn transpose_self(&mut self)

fn determinant(&self) -> S

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

fn invert(&self) -> Option<Matrix3<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 Matrix3<S>

fn approx_eq_eps(&self, other: &Matrix3<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 Matrix3<S>

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

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

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

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

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

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

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

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

fn from(b: Basis3<S>) -> Matrix3<S>

impl<S: BaseFloat + 'static, R: Rotation2<S>> From<Decomposed<S, Vector2<S>, R>> for Matrix3<S>

fn from(dec: Decomposed<S, Vector2<S>, R>) -> Matrix3<S>

Derived Implementations

impl<S: Decodable> Decodable for Matrix3<S>

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

impl<S: Encodable> Encodable for Matrix3<S>

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

impl<S: PartialEq> PartialEq for Matrix3<S>

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

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

impl<S: Clone> Clone for Matrix3<S>

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

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

impl<S: Copy> Copy for Matrix3<S>