diff --git a/src/vector.rs b/src/vector.rs index 317b423..407602a 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -324,13 +324,6 @@ impl Vector3 { (self.x * other.y) - (self.y * other.x)) } - /// Calculates the cross product of the vector and `other`, then stores the - /// result in `self`. - #[inline] - pub fn cross_self(&mut self, other: Vector3) { - *self = self.cross(other) - } - /// Create a `Vector4`, using the `x`, `y` and `z` values from this vector, and the /// provided `w`. #[inline] @@ -414,7 +407,7 @@ pub trait EuclideanVector: Vector + Sized where /// The norm of the vector. #[inline] fn length(self) -> Self::Scalar { - // Not sure why these annotations are needed + // FIXME: Not sure why this annotation is needed <::Scalar as ::rust_num::Float>::sqrt(self.dot(self)) } @@ -443,28 +436,6 @@ pub trait EuclideanVector: Vector + Sized where fn lerp(self, other: Self, amount: Self::Scalar) -> Self { self + ((other - self) * amount) } - - /// Normalises the vector to a length of `1`. - #[inline] - fn normalize_self(&mut self) { - // Not sure why these annotations are needed - let rlen = <::Scalar as ::rust_num::Float>::recip(self.length()); - *self = *self * rlen; - } - - /// Normalizes the vector to `length`. - #[inline] - fn normalize_self_to(&mut self, length: Self::Scalar) { - let n = length / self.length(); - *self = *self * n; - } - - /// Linearly interpolates the length of the vector towards the length of - /// `other` by the specified amount. - fn lerp_self(&mut self, other: Self, amount: Self::Scalar) { - let v = (other - *self) * amount; - *self = *self * v; - } } impl EuclideanVector for Vector2 { diff --git a/tests/vector.rs b/tests/vector.rs index 241737c..cd76a1b 100644 --- a/tests/vector.rs +++ b/tests/vector.rs @@ -90,10 +90,6 @@ fn test_cross() { let b = Vector3::new(4isize, 5isize, 6isize); let r = Vector3::new(-3isize, 6isize, -3isize); assert_eq!(a.cross(b), r); - - let mut a = a; - a.cross_self(b); - assert_eq!(a, r); } #[test]