diff --git a/src/cgmath/angle.rs b/src/cgmath/angle.rs index 657db1e..8f535ac 100644 --- a/src/cgmath/angle.rs +++ b/src/cgmath/angle.rs @@ -80,6 +80,7 @@ pub trait Angle + ToRad + ToDeg + ScalarConv ++ fmt::Show { /// Create a new angle from any other valid angle. fn from>(theta: A) -> Self; diff --git a/src/cgmath/lib.rs b/src/cgmath/lib.rs index edaee38..f97d4b6 100644 --- a/src/cgmath/lib.rs +++ b/src/cgmath/lib.rs @@ -36,8 +36,6 @@ //! `look_at`, `from_angle`, `from_euler`, and `from_axis_angle` methods. //! These are provided for convenience. -extern crate debug; - pub mod array; pub mod matrix; diff --git a/src/cgmath/projection.rs b/src/cgmath/projection.rs index 7daee8e..35d8cbc 100644 --- a/src/cgmath/projection.rs +++ b/src/cgmath/projection.rs @@ -105,12 +105,12 @@ impl> ToMatrix4 for PerspectiveFov { fn to_matrix4(&self) -> Matrix4 { let half_turn: A = Angle::turn_div_2(); - assert!(self.fovy > zero(), "The vertical field of view cannot be below zero, found: {:?}", self.fovy); - assert!(self.fovy < half_turn, "The vertical field of view cannot be greater than a half turn, found: {:?}", self.fovy); - assert!(self.aspect > zero(), "The aspect ratio cannot be below zero, found: {:?}", self.aspect); - assert!(self.near > zero(), "The near plane distance cannot be below zero, found: {:?}", self.near); - assert!(self.far > zero(), "The far plane distance cannot be below zero, found: {:?}", self.far); - assert!(self.far > self.near, "The far plane cannot be closer than the near plane, found: far: {:?}, near: {:?}", self.far, self.near); + assert!(self.fovy > zero(), "The vertical field of view cannot be below zero, found: {}", self.fovy); + assert!(self.fovy < half_turn, "The vertical field of view cannot be greater than a half turn, found: {}", self.fovy); + assert!(self.aspect > zero(), "The aspect ratio cannot be below zero, found: {}", self.aspect); + assert!(self.near > zero(), "The near plane distance cannot be below zero, found: {}", self.near); + assert!(self.far > zero(), "The far plane distance cannot be below zero, found: {}", self.far); + assert!(self.far > self.near, "The far plane cannot be closer than the near plane, found: far: {}, near: {}", self.far, self.near); let f = cot(self.fovy.div_s(cast(2).unwrap()).to_rad()); let two: S = cast(2).unwrap(); @@ -159,9 +159,9 @@ impl Projection for Perspective { impl ToMatrix4 for Perspective { fn to_matrix4(&self) -> Matrix4 { - assert!(self.left > self.right, "`left` cannot be greater than `right`, found: left: {:?} right: {:?}", self.left, self.right); - assert!(self.bottom > self.top, "`bottom` cannot be greater than `top`, found: bottom: {:?} top: {:?}", self.bottom, self.top); - assert!(self.near > self.far, "`near` cannot be greater than `far`, found: near: {:?} far: {:?}", self.near, self.far); + assert!(self.left > self.right, "`left` cannot be greater than `right`, found: left: {} right: {}", self.left, self.right); + assert!(self.bottom > self.top, "`bottom` cannot be greater than `top`, found: bottom: {} top: {}", self.bottom, self.top); + assert!(self.near > self.far, "`near` cannot be greater than `far`, found: near: {} far: {}", self.near, self.far); let two: S = cast(2).unwrap(); @@ -215,9 +215,9 @@ impl Projection for Ortho { impl ToMatrix4 for Ortho { fn to_matrix4(&self) -> Matrix4 { - assert!(self.left < self.right, "`left` cannot be greater than `right`, found: left: {:?} right: {:?}", self.left, self.right); - assert!(self.bottom < self.top, "`bottom` cannot be greater than `top`, found: bottom: {:?} top: {:?}", self.bottom, self.top); - assert!(self.near < self.far, "`near` cannot be greater than `far`, found: near: {:?} far: {:?}", self.near, self.far); + assert!(self.left < self.right, "`left` cannot be greater than `right`, found: left: {} right: {}", self.left, self.right); + assert!(self.bottom < self.top, "`bottom` cannot be greater than `top`, found: bottom: {} top: {}", self.bottom, self.top); + assert!(self.near < self.far, "`near` cannot be greater than `far`, found: near: {} far: {}", self.near, self.far); let two: S = cast(2).unwrap();