diff --git a/src/array.rs b/src/array.rs index b6b240e..595a1b0 100644 --- a/src/array.rs +++ b/src/array.rs @@ -28,20 +28,6 @@ pub trait Array1: Index + IndexMut &mut (*self)[0] } - /// Get a shared reference to the `i`th value. - #[deprecated = "Use index operator instead"] - #[inline] - fn i<'a>(&'a self, i: uint) -> &'a Element { - &(*self)[i] - } - - /// Get a mutable reference to the `i`th value. - #[deprecated = "Use index operator instead"] - #[inline] - fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut Element { - &mut (*self)[i] - } - #[inline] /// Swap the elements at indices `i` and `j` in-place. fn swap_i(&mut self, i: uint, j: uint) { @@ -72,20 +58,6 @@ pub trait Array2, Row: Array1, Element: Copy>: &mut (*self)[0][0] } - /// Get a shared reference to a column of this array. - #[deprecated = "Use index operator instead"] - #[inline] - fn c<'a>(&'a self, c: uint) -> &'a Column { - &(*self)[c] - } - - /// Get a mutable reference to a column of this array. - #[deprecated = "Use index operator instead"] - #[inline] - fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Column { - &mut (*self)[c] - } - /// Swap two columns of this array. #[inline] fn swap_c(&mut self, a: uint, b: uint) { @@ -104,20 +76,6 @@ pub trait Array2, Row: Array1, Element: Copy>: /// Swap two rows of this array. fn swap_r(&mut self, a: uint, b: uint); - /// Return a shared reference to the element at column `c` and row `r`. - #[deprecated = "Use index operators instead"] - #[inline] - fn cr<'a>(&'a self, c: uint, r: uint) -> &'a Element { - &(*self)[c][r] - } - - /// Return a mutable reference to the element at column `c` and row `r`. - #[deprecated = "Use index operators instead"] - #[inline] - fn mut_cr<'a>(&'a mut self, c: uint, r: uint) -> &'a mut Element { - &mut (*self)[c][r] - } - /// Swap the values at index `a` and `b` #[inline] fn swap_cr(&mut self, a: (uint, uint), b: (uint, uint)) { diff --git a/src/matrix.rs b/src/matrix.rs index d6a3c20..a0a84f3 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -209,7 +209,7 @@ Matrix3 { _1subc * axis.z * axis.z + c) } - /// Create a matrix from a non-uniform scale + /// Create a matrix from a non-uniform scale pub fn from_diagonal(value: &Vector3) -> Matrix3 { Matrix3::new(value.x, zero(), zero(), zero(), value.y, zero(), @@ -377,9 +377,9 @@ impl Sub, Matrix2> for Matrix2 { #[inline] fn sub impl Sub, Matrix3> for Matrix3 { #[inline] fn sub(&self, other: &Matrix3) -> Matrix3 { self.sub_m(other) } } impl Sub, Matrix4> for Matrix4 { #[inline] fn sub(&self, other: &Matrix4) -> Matrix4 { self.sub_m(other) } } -impl Neg> for Matrix2 { #[inline] fn neg(&self) -> Matrix2 { Matrix2::from_cols(self.c(0).neg(), self.c(1).neg()) } } -impl Neg> for Matrix3 { #[inline] fn neg(&self) -> Matrix3 { Matrix3::from_cols(self.c(0).neg(), self.c(1).neg(), self.c(2).neg()) } } -impl Neg> for Matrix4 { #[inline] fn neg(&self) -> Matrix4 { Matrix4::from_cols(self.c(0).neg(), self.c(1).neg(), self.c(2).neg(), self.c(3).neg()) } } +impl Neg> for Matrix2 { #[inline] fn neg(&self) -> Matrix2 { Matrix2::from_cols(self[0].neg(), self[1].neg()) } } +impl Neg> for Matrix3 { #[inline] fn neg(&self) -> Matrix3 { Matrix3::from_cols(self[0].neg(), self[1].neg(), self[2].neg()) } } +impl Neg> for Matrix4 { #[inline] fn neg(&self) -> Matrix4 { Matrix4::from_cols(self[0].neg(), self[1].neg(), self[2].neg(), self[3].neg()) } } impl Zero for Matrix2 { #[inline] fn zero() -> Matrix2 { Matrix2::zero() } #[inline] fn is_zero(&self) -> bool { *self == zero() } } impl Zero for Matrix3 { #[inline] fn zero() -> Matrix3 { Matrix3::zero() } #[inline] fn is_zero(&self) -> bool { *self == zero() } }