diff --git a/src/math/rotation.rs b/src/math/rotation.rs index 1ade5e7..7cd6706 100644 --- a/src/math/rotation.rs +++ b/src/math/rotation.rs @@ -68,8 +68,6 @@ pub struct RotationMat { priv mat: Mat3 } -impl_dimensioned!(RotationMat, Vec3, 3) - impl RotationMat { #[inline] pub fn as_mat3<'a>(&'a self) -> & 'a Mat3 { @@ -103,39 +101,6 @@ impl ToMat4 for RotationMat { #[inline] pub fn to_mat4(&self) -> Mat4 { self.mat.to_mat4() } } -impl Mat,[Vec3,..3]> for RotationMat { - #[inline] - pub fn col<'a>(&'a self, i: uint) -> &'a Vec3 { self.mat.col(i) } - - #[inline] - pub fn col_mut<'a>(&'a mut self, i: uint) -> &'a mut Vec3 { self.mat.col_mut(i) } - - #[inline] - pub fn elem<'a>(&'a self, col: uint, row: uint) -> &'a T { self.mat.elem(col, row) } - - #[inline] - pub fn elem_mut<'a>(&'a mut self, col: uint, row: uint) -> &'a mut T { self.mat.elem_mut(col, row) } - - #[inline] - pub fn swap_cols(&mut self, a: uint, b: uint) { self.mat.swap_cols(a, b) } - - #[inline] - pub fn row(&self, i: uint) -> Vec3 { self.mat.row(i) } - - #[inline] - pub fn swap_rows(&mut self, a: uint, b: uint) { self.mat.swap_rows(a, b) } - - #[inline] - pub fn swap_elem(&mut self, a: (uint, uint), b: (uint, uint)) { self.mat.swap_elem(a, b) } - - #[inline] - pub fn transpose(&self) -> RotationMat { RotationMat { mat: self.mat.transpose() } } - - #[inline] - pub fn transpose_self(&mut self) { self.mat.transpose_self() } - -} - impl RotationMat { #[inline] pub fn identity() -> RotationMat { @@ -148,62 +113,6 @@ impl RotationMat { } } -impl RotationMat { - #[inline] - pub fn from_value(value: T) -> RotationMat { - RotationMat { mat: Mat3::from_value(value) } - } -} - -impl NumMat,[Vec3,..3]> for RotationMat { - #[inline] - pub fn mul_t(&self, value: T) -> RotationMat { - RotationMat { mat: self.mat.mul_t(value) } - } - - #[inline] - pub fn mul_v(&self, vec: &Vec3) -> Vec3 { self.mat.mul_v(vec) } - - #[inline] - pub fn add_m(&self, other: &RotationMat) -> RotationMat { - RotationMat { mat: self.mat.add_m(&other.mat) } - } - - #[inline] - pub fn sub_m(&self, other: &RotationMat) -> RotationMat { - RotationMat { mat: self.mat.sub_m(&other.mat) } - } - - #[inline] - pub fn mul_m(&self, other: &RotationMat) -> RotationMat { - RotationMat { mat: self.mat.mul_m(&other.mat) } - } - - #[inline] - pub fn mul_self_t(&mut self, value: T) { self.mat.mul_self_t(value) } - - #[inline] - pub fn add_self_m(&mut self, other: &RotationMat) { self.mat.add_self_m(&other.mat) } - - #[inline] - pub fn sub_self_m(&mut self, other: &RotationMat) { self.mat.sub_self_m(&other.mat) } - - #[inline] - pub fn dot(&self, other: &RotationMat) -> T { self.mat.dot(&other.mat) } - - #[inline] - pub fn determinant(&self) -> T { self.mat.determinant() } - - #[inline] - pub fn trace(&self) -> T { self.mat.trace() } - - #[inline] - pub fn to_identity(&mut self) { self.mat.to_identity() } - - #[inline] - pub fn to_zero(&mut self) { self.mat.to_zero() } -} - impl Neg> for RotationMat { #[inline] pub fn neg(&self) -> RotationMat { @@ -217,31 +126,6 @@ impl RotationMat { } } -impl FloatMat,[Vec3,..3]> for RotationMat { - #[inline] - pub fn inverse(&self) -> Option> { - unsafe { cast::transmute(self.mat.inverse()) } - } - - #[inline] - pub fn invert_self(&mut self) { self.mat.invert_self() } - - #[inline] - pub fn is_identity(&self) -> bool { self.mat.is_identity() } - - #[inline] - pub fn is_diagonal(&self) -> bool { self.mat.is_diagonal() } - - #[inline] - pub fn is_rotated(&self) -> bool { self.mat.is_rotated() } - - #[inline] - pub fn is_symmetric(&self) -> bool { self.mat.is_symmetric() } - - #[inline] - pub fn is_invertible(&self) -> bool { self.mat.is_invertible() } -} - impl> ApproxEq for RotationMat { #[inline] pub fn approx_epsilon() -> T {