From 7f05cc5977d9e6537732916f25c5707fa84bb1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Wed, 10 Jul 2013 17:43:45 +0000 Subject: [PATCH] abs needs the Signed trait. --- src/lib.rs | 0 src/vec_spec.rs | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/lib.rs diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..e69de29b diff --git a/src/vec_spec.rs b/src/vec_spec.rs index 82a8c3f2..9b4962c0 100644 --- a/src/vec_spec.rs +++ b/src/vec_spec.rs @@ -1,6 +1,6 @@ use std::vec::{VecIterator, VecMutIterator}; use std::iterator::FromIterator; -use std::num::{Zero, One, abs}; +use std::num::{Zero, One}; use traits::basis::Basis; use traits::cross::Cross; use traits::division_ring::DivisionRing; @@ -69,7 +69,7 @@ impl> Basis for Vec2 { f(Vec2::new([-self.at[1], self.at[0].clone()])) } } -impl +impl Basis for Vec3 { #[inline(always)] @@ -84,7 +84,7 @@ Basis for Vec3 fn orthonormal_subspace_basis(&self, f: &fn(Vec3)) { let a = - if abs(self.at[0].clone()) > abs(self.at[1].clone()) + if self.at[0].clone().abs() > self.at[1].clone().abs() { Vec3::new([self.at[2].clone(), Zero::zero(), -self.at[0]]).normalized() } else { Vec3::new([Zero::zero(), -self.at[2], self.at[1].clone()]).normalized() };