Trait glm::GenMat
[−]
[src]
pub trait GenMat<T: BaseFloat, C: GenFloatVec<T>>: Sized + Zero + Add<Output = Self> + Sub<Output = Self> + Div<Output = Self> + Rem<Output = Self> + Neg<Output = Self> + Mul<T, Output = Self> + Index<usize, Output = C> + IndexMut<usize> + ApproxEq<BaseType = T> { type R: GenFloatVec<T>; type Transpose: GenMat<T, Self::R, R = C, Transpose = Self>; fn transpose(&self) -> Self::Transpose; fn mul_c(&self, rhs: &Self) -> Self; }
Generic Matrix type.
Associated Types
type R: GenFloatVec<T>
Type of row vectors.
type Transpose: GenMat<T, Self::R, R = C, Transpose = Self>
Type of transpose matrix.
Required Methods
fn transpose(&self) -> Self::Transpose
Returns the transpose matrix.
Example
use glm::GenMat; // bing the method into scope. let m = glm::mat3x2(1., 2., 3., 4., 5., 6.); let tm = glm::mat2x3(1., 3., 5., 2., 4., 6.); assert_eq!(tm, m.transpose());
fn mul_c(&self, rhs: &Self) -> Self
Component-wise multiplication.
Example
use glm::GenMat; // bing the method into scope. let m1 = glm::mat2(1., 2., 3., 4.); let m2 = glm::mat2(0., 0., -7., 0.5); assert_eq!(m1.mul_c(&m2), glm::mat2(0., 0., -21., 2.));
Implementors
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix2<T> type R = Vector2<T>; type Transpose = Matrix2<T>;
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix3x2<T> type R = Vector3<T>; type Transpose = Matrix2x3<T>;
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix4x2<T> type R = Vector4<T>; type Transpose = Matrix2x4<T>;
impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix2x3<T> type R = Vector2<T>; type Transpose = Matrix3x2<T>;
impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix3<T> type R = Vector3<T>; type Transpose = Matrix3<T>;
impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix4x3<T> type R = Vector4<T>; type Transpose = Matrix3x4<T>;
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix2x4<T> type R = Vector2<T>; type Transpose = Matrix4x2<T>;
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix3x4<T> type R = Vector3<T>; type Transpose = Matrix4x3<T>;
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix4<T> type R = Vector4<T>; type Transpose = Matrix4<T>;