From 141c4a86841454dc5ebc7c641addef067b6359e3 Mon Sep 17 00:00:00 2001 From: ozkriff Date: Thu, 20 Feb 2014 14:13:47 +0400 Subject: [PATCH] Updated to latest Rust --- src/cgmath/angle.rs | 2 +- src/test/vector.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cgmath/angle.rs b/src/cgmath/angle.rs index 9b7defc..89441b4 100644 --- a/src/cgmath/angle.rs +++ b/src/cgmath/angle.rs @@ -181,7 +181,7 @@ Equiv> for Deg { impl> Angle for Rad { #[inline] fn from>(theta: A) -> Rad { theta.to_rad() } - #[inline] fn full_turn() -> Rad { rad(Real::two_pi()) } + #[inline] fn full_turn() -> Rad { rad(Float::two_pi()) } } impl> diff --git a/src/test/vector.rs b/src/test/vector.rs index 029308b..61e4978 100644 --- a/src/test/vector.rs +++ b/src/test/vector.rs @@ -137,17 +137,17 @@ mod test_length { #[test] fn test_angle() { - assert!(Vec2::new(1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec2::new(10.0, 0.0).angle(&Vec2::new(0.0, 5.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec2::new(-1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &-rad(Real::frac_pi_2()) )); + assert!(Vec2::new(1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec2::new(10.0, 0.0).angle(&Vec2::new(0.0, 5.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec2::new(-1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &-rad(Float::frac_pi_2()) )); - assert!(Vec3::new(1.0, 0.0, 1.0).angle(&Vec3::new(1.0, 1.0, 0.0)).approx_eq( &rad(Real::frac_pi_3()) )); - assert!(Vec3::new(10.0, 0.0, 10.0).angle(&Vec3::new(5.0, 5.0, 0.0)).approx_eq( &rad(Real::frac_pi_3()) )); - assert!(Vec3::new(-1.0, 0.0, -1.0).angle(&Vec3::new(1.0, -1.0, 0.0)).approx_eq( &rad(2.0 * Real::frac_pi_3()) )); + assert!(Vec3::new(1.0, 0.0, 1.0).angle(&Vec3::new(1.0, 1.0, 0.0)).approx_eq( &rad(Float::frac_pi_3()) )); + assert!(Vec3::new(10.0, 0.0, 10.0).angle(&Vec3::new(5.0, 5.0, 0.0)).approx_eq( &rad(Float::frac_pi_3()) )); + assert!(Vec3::new(-1.0, 0.0, -1.0).angle(&Vec3::new(1.0, -1.0, 0.0)).approx_eq( &rad(2.0 * Float::frac_pi_3()) )); - assert!(Vec4::new(1.0, 0.0, 1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec4::new(10.0, 0.0, 10.0, 0.0).angle(&Vec4::new(0.0, 5.0, 0.0, 5.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec4::new(-1.0, 0.0, -1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); + assert!(Vec4::new(1.0, 0.0, 1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec4::new(10.0, 0.0, 10.0, 0.0).angle(&Vec4::new(0.0, 5.0, 0.0, 5.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec4::new(-1.0, 0.0, -1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); } #[test]