diff --git a/src/matrix.rs b/src/matrix.rs index 8ea8161..16721c3 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -1,6 +1,5 @@ use cast::transmute; use cmp::Eq; -use num::from_int; use ptr::to_unsafe_ptr; use vec::raw::buf_as_slice; use std::cmp::FuzzyEq; @@ -508,7 +507,7 @@ pub impl Mat3: ToQuat { let w: float, x: float, y: float, z: float; let trace: float = cast(self[0][0] + self[1][1] + self[2][2]); - if trace >= from_int(0) { + if trace >= cast(0) { s = (trace + 1f).sqrt(); w = 0.5 * s; s = 0.5 / s; diff --git a/src/quaternion.rs b/src/quaternion.rs index 08fdd46..91f1688 100644 --- a/src/quaternion.rs +++ b/src/quaternion.rs @@ -157,7 +157,7 @@ pub impl Quat: Quaternion #[inline(always)] pure fn inverse() -> Quat { - let mut n: T = from_int(1); + let mut n: T = cast(1); n /= self.length2(); self.conjugate().mul_t(n) } diff --git a/src/vector.rs b/src/vector.rs index 2e73f62..926450a 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -1,6 +1,5 @@ use cast::transmute; use cmp::{Eq, Ord}; -use num::from_int; use vec::raw::buf_as_slice; use ptr::to_unsafe_ptr; use std::cmp::FuzzyEq; @@ -155,7 +154,7 @@ pub impl Vec2: NumericVector { } } -pub impl Vec2: GeometricVector { +pub impl Vec2: GeometricVector { #[inline(always)] pure fn length2() -> T { self[0] * self[0] + @@ -169,7 +168,7 @@ pub impl Vec2: GeometricVector { #[inline(always)] pure fn normalize() -> Vec2 { - let mut n: T = from_int(1); + let mut n: T = cast(1); n /= self.length(); return self.mul_t(n); } @@ -340,7 +339,7 @@ pub impl Vec3: NumericVector { } } -pub impl Vec3: GeometricVector { +pub impl Vec3: GeometricVector { #[inline(always)] pure fn length2() -> T { self[0] * self[0] + @@ -355,7 +354,7 @@ pub impl Vec3: GeometricVector { #[inline(always)] pure fn normalize() -> Vec3 { - let mut n: T = from_int(1); + let mut n: T = cast(1); n /= self.length(); return self.mul_t(n); } @@ -531,7 +530,7 @@ pub impl Vec4: NumericVector { } } -pub impl Vec4: GeometricVector { +pub impl Vec4: GeometricVector { #[inline(always)] pure fn length2() -> T { self[0] * self[0] + @@ -547,7 +546,7 @@ pub impl Vec4: GeometricVector { #[inline(always)] pure fn normalize() -> Vec4 { - let mut n: T = from_int(1); + let mut n: T = cast(1); n /= self.length(); return self.mul_t(n); }