Fixed the num crate
This commit is contained in:
parent
3bd90171e9
commit
16302ffa20
8 changed files with 9 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
|
||||
name = "cgmath"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>",
|
||||
"Brian Heylin",
|
||||
"Colin Sherratt",
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
|
||||
use std::fmt;
|
||||
use std::f64;
|
||||
use std::num::cast;
|
||||
use std::ops::*;
|
||||
|
||||
use rand::{Rand, Rng};
|
||||
use rand::distributions::range::SampleRange;
|
||||
|
||||
use rust_num::{Float, One, Zero, one, zero};
|
||||
use rust_num::traits::cast;
|
||||
|
||||
use approx::ApproxEq;
|
||||
use num::BaseFloat;
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::num::{NumCast, cast};
|
||||
use rust_num::Float;
|
||||
use rust_num::{Float, NumCast};
|
||||
use rust_num::traits::cast;
|
||||
|
||||
pub trait ApproxEq<T: NumCast + Float>: Sized {
|
||||
fn approx_epsilon(_hack: Option<Self>) -> T {
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::num::cast;
|
||||
use std::ops::*;
|
||||
|
||||
use rand::{Rand, Rng};
|
||||
|
||||
use rust_num::{Zero, zero, One, one};
|
||||
use rust_num::traits::cast;
|
||||
|
||||
use angle::{Rad, sin, cos, sin_cos};
|
||||
use approx::ApproxEq;
|
||||
|
|
|
@ -17,9 +17,8 @@ use approx::ApproxEq;
|
|||
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use std::num::NumCast;
|
||||
|
||||
use rust_num::{Float, Num};
|
||||
use rust_num::{Float, Num, NumCast};
|
||||
|
||||
/// A trait providing a [partial ordering](http://mathworld.wolfram.com/PartialOrder.html).
|
||||
pub trait PartialOrd {
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::num::cast;
|
||||
|
||||
use rust_num::{zero, one};
|
||||
use rust_num::traits::cast;
|
||||
|
||||
use angle::{Angle, tan, cot};
|
||||
use frustum::Frustum;
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
use std::f64;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::num::cast;
|
||||
use std::ops::*;
|
||||
|
||||
use rand::{Rand, Rng};
|
||||
use rust_num::{Float, one, zero};
|
||||
use rust_num::traits::cast;
|
||||
|
||||
use angle::{Angle, Rad, acos, sin, sin_cos, rad};
|
||||
use approx::ApproxEq;
|
||||
|
@ -242,8 +242,6 @@ impl<S: BaseFloat> Quaternion<S> {
|
|||
/// - [Arcsynthesis OpenGL tutorial]
|
||||
/// (http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Interpolation.html)
|
||||
pub fn slerp(&self, other: &Quaternion<S>, amount: S) -> Quaternion<S> {
|
||||
use std::num::cast;
|
||||
|
||||
let dot = self.dot(other);
|
||||
let dot_threshold = cast(0.9995f64).unwrap();
|
||||
|
||||
|
|
|
@ -98,12 +98,11 @@
|
|||
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::num::NumCast;
|
||||
use std::ops::*;
|
||||
|
||||
use rand::{Rand, Rng};
|
||||
|
||||
use rust_num::{Zero, One, zero, one};
|
||||
use rust_num::{NumCast, Zero, One, zero, one};
|
||||
|
||||
use angle::{Rad, atan2, acos};
|
||||
use approx::ApproxEq;
|
||||
|
|
Loading…
Reference in a new issue