diff --git a/CHANGELOG.md b/CHANGELOG.md index c47a0ea..e6cf961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### v0.20 - No actual API change, but updated to Rust2018 and synced with cgmath 0.17 - - Uses latest versions of rand and approx for compatibility with other libraries + - Uses the latest versions of rand and approx for compatibility with other libraries ### v0.19 - Updated version of num library to 0.2 diff --git a/Cargo.toml b/Cargo.toml index 994c2b7..73d7b31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,6 @@ name = "collision" [dependencies] rand = "0.8.4" -approx = "0.4" # Only for the macros; for all other instances use the re-exported cgmath ones. cgmath = "0.18.0" serde = { version = "1.0.126", optional = true, features = ["derive"] } bit-set = "0.5.2" diff --git a/README.md b/README.md index f4f51d8..fc16234 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ at your option. ## Contributing -Use [CONTRIBUTING.md](https://github.com/rustgd/collision-rs/blob/master/CONTRIBUTING.md) for futher information. +Use [CONTRIBUTING.md](https://github.com/rustgd/collision-rs/blob/master/CONTRIBUTING.md) for further information. Pull requests are most welcome, especially in the realm of performance enhancements and fixing any mistakes. Unit tests and benchmarks are also diff --git a/benches/dbvt.rs b/benches/dbvt.rs index f0aa4fe..fe16090 100644 --- a/benches/dbvt.rs +++ b/benches/dbvt.rs @@ -1,8 +1,5 @@ #![feature(test)] -extern crate cgmath; -extern crate collision; -extern crate rand; extern crate test; use cgmath::prelude::*; diff --git a/benches/polyhedron.rs b/benches/polyhedron.rs index 0bb4395..4b53594 100644 --- a/benches/polyhedron.rs +++ b/benches/polyhedron.rs @@ -1,9 +1,5 @@ #![feature(test)] -extern crate cgmath; -extern crate collision; -extern crate genmesh; -extern crate rand; extern crate test; use cgmath::prelude::*; diff --git a/src/algorithm/minkowski/epa/epa2d.rs b/src/algorithm/minkowski/epa/epa2d.rs index 26dc6ee..d9b8202 100644 --- a/src/algorithm/minkowski/epa/epa2d.rs +++ b/src/algorithm/minkowski/epa/epa2d.rs @@ -1,6 +1,6 @@ use std::marker; -use approx::assert_ulps_ne; +use cgmath::assert_ulps_ne; use cgmath::num_traits::NumCast; use cgmath::prelude::*; use cgmath::{BaseFloat, Point2, Vector2}; @@ -157,7 +157,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Rotation2, Vector2}; use super::*; diff --git a/src/algorithm/minkowski/epa/epa3d.rs b/src/algorithm/minkowski/epa/epa3d.rs index 46a82c7..489a357 100644 --- a/src/algorithm/minkowski/epa/epa3d.rs +++ b/src/algorithm/minkowski/epa/epa3d.rs @@ -220,7 +220,7 @@ fn remove_or_add_edge(edges: &mut Vec<(usize, usize)>, edge: (usize, usize)) { #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Decomposed, Quaternion, Rad, Vector3}; use super::*; diff --git a/src/algorithm/minkowski/gjk/mod.rs b/src/algorithm/minkowski/gjk/mod.rs index ab97d35..095b5d8 100644 --- a/src/algorithm/minkowski/gjk/mod.rs +++ b/src/algorithm/minkowski/gjk/mod.rs @@ -15,7 +15,7 @@ use self::simplex::{Simplex, SimplexProcessor2, SimplexProcessor3}; use crate::algorithm::minkowski::{SupportPoint, EPA, EPA2, EPA3}; use crate::prelude::*; use crate::{CollisionStrategy, Contact}; -use approx::ulps_eq; +use cgmath::ulps_eq; mod simplex; @@ -590,7 +590,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{ Basis2, Decomposed, Point2, Point3, Quaternion, Rad, Rotation2, Rotation3, Vector2, Vector3, }; diff --git a/src/algorithm/minkowski/gjk/simplex/simplex2d.rs b/src/algorithm/minkowski/gjk/simplex/simplex2d.rs index 22874e2..d8c6a17 100644 --- a/src/algorithm/minkowski/gjk/simplex/simplex2d.rs +++ b/src/algorithm/minkowski/gjk/simplex/simplex2d.rs @@ -1,8 +1,8 @@ use std::marker; use std::ops::Neg; -use approx::ulps_eq; use cgmath::prelude::*; +use cgmath::ulps_eq; use cgmath::{BaseFloat, Point2, Vector2}; use super::{Simplex, SimplexProcessor}; @@ -101,7 +101,7 @@ mod tests { use super::*; use crate::algorithm::minkowski::SupportPoint; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use smallvec::smallvec; #[test] diff --git a/src/algorithm/minkowski/gjk/simplex/simplex3d.rs b/src/algorithm/minkowski/gjk/simplex/simplex3d.rs index 3925240..0c0fd7a 100644 --- a/src/algorithm/minkowski/gjk/simplex/simplex3d.rs +++ b/src/algorithm/minkowski/gjk/simplex/simplex3d.rs @@ -1,9 +1,9 @@ use std::marker; use std::ops::Neg; -use approx::ulps_eq; use cgmath::num_traits::cast; use cgmath::prelude::*; +use cgmath::ulps_eq; use cgmath::{BaseFloat, Point3, Vector3}; use super::{Simplex, SimplexProcessor}; @@ -223,7 +223,7 @@ fn check_side( mod tests { use std::ops::Neg; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Point3, Vector3}; use smallvec::smallvec; diff --git a/src/plane.rs b/src/plane.rs index cde67b1..9c9dbdc 100644 --- a/src/plane.rs +++ b/src/plane.rs @@ -1,7 +1,7 @@ use std::fmt; -use approx::{ulps_eq, ulps_ne}; use cgmath::prelude::*; +use cgmath::{ulps_eq, ulps_ne}; use cgmath::{AbsDiffEq, RelativeEq, UlpsEq}; use cgmath::{BaseFloat, Point3, Vector3, Vector4}; diff --git a/src/primitive/capsule.rs b/src/primitive/capsule.rs index 4c69cce..d16d79b 100644 --- a/src/primitive/capsule.rs +++ b/src/primitive/capsule.rs @@ -201,7 +201,7 @@ where mod tests { use std; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Decomposed, Quaternion, Rad, Vector3}; use super::*; diff --git a/src/primitive/circle.rs b/src/primitive/circle.rs index 3d297ab..8c61452 100644 --- a/src/primitive/circle.rs +++ b/src/primitive/circle.rs @@ -93,7 +93,7 @@ mod tests { use crate::prelude::*; use crate::Ray2; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Rotation2, Vector2}; use super::*; diff --git a/src/primitive/cuboid.rs b/src/primitive/cuboid.rs index 44efa85..cfbcf06 100644 --- a/src/primitive/cuboid.rs +++ b/src/primitive/cuboid.rs @@ -214,7 +214,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Decomposed, Point3, Quaternion, Rad, Vector3}; use super::*; diff --git a/src/primitive/cylinder.rs b/src/primitive/cylinder.rs index 1c04fca..aebddf6 100644 --- a/src/primitive/cylinder.rs +++ b/src/primitive/cylinder.rs @@ -231,7 +231,7 @@ where mod tests { use std; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Decomposed, Quaternion, Rad, Vector3}; use super::*; diff --git a/src/primitive/particle.rs b/src/primitive/particle.rs index e668f37..82e39c5 100644 --- a/src/primitive/particle.rs +++ b/src/primitive/particle.rs @@ -161,7 +161,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::prelude::*; use cgmath::{Basis2, Decomposed, Point2, Rad, Vector2}; diff --git a/src/primitive/polygon.rs b/src/primitive/polygon.rs index 513905a..bc22b44 100644 --- a/src/primitive/polygon.rs +++ b/src/primitive/polygon.rs @@ -196,7 +196,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Vector2}; use super::*; diff --git a/src/primitive/polyhedron.rs b/src/primitive/polyhedron.rs index bec4d35..0453c56 100644 --- a/src/primitive/polyhedron.rs +++ b/src/primitive/polyhedron.rs @@ -576,7 +576,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::prelude::*; use cgmath::{Decomposed, Point3, Quaternion, Rad, Vector3}; diff --git a/src/primitive/rectangle.rs b/src/primitive/rectangle.rs index 2c28b1d..e24bdf2 100644 --- a/src/primitive/rectangle.rs +++ b/src/primitive/rectangle.rs @@ -184,7 +184,7 @@ where #[cfg(test)] mod tests { - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Vector2}; use super::*; diff --git a/src/primitive/sphere.rs b/src/primitive/sphere.rs index 778db5b..557dfa3 100644 --- a/src/primitive/sphere.rs +++ b/src/primitive/sphere.rs @@ -101,7 +101,7 @@ where mod tests { use std; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Decomposed, Point3, Quaternion, Rad, Rotation3, Vector3}; use super::*; diff --git a/src/primitive/util.rs b/src/primitive/util.rs index a887fcb..3435c6a 100644 --- a/src/primitive/util.rs +++ b/src/primitive/util.rs @@ -138,7 +138,7 @@ where mod tests { use std; - use approx::assert_ulps_eq; + use cgmath::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Rotation2, Vector2}; use super::*; diff --git a/tests/aabb.rs b/tests/aabb.rs index 5f2d9be..7ae959d 100644 --- a/tests/aabb.rs +++ b/tests/aabb.rs @@ -1,6 +1,3 @@ -extern crate cgmath; -extern crate collision; - use cgmath::InnerSpace; use cgmath::{Point2, Point3}; use cgmath::{Vector2, Vector3}; diff --git a/tests/bound.rs b/tests/bound.rs index dd9ca43..22b0dd7 100644 --- a/tests/bound.rs +++ b/tests/bound.rs @@ -1,5 +1,3 @@ -extern crate collision; - use collision::PlaneBound; fn _box(_: Box>) {} diff --git a/tests/dbvt.rs b/tests/dbvt.rs index 2da3fc3..b8c33a9 100644 --- a/tests/dbvt.rs +++ b/tests/dbvt.rs @@ -1,7 +1,3 @@ -extern crate cgmath; -extern crate collision; -extern crate rand; - use cgmath::prelude::*; use cgmath::{Deg, PerspectiveFov, Point2, Point3, Vector2, Vector3}; use collision::dbvt::*; diff --git a/tests/frustum.rs b/tests/frustum.rs index a7cdf7b..59cae39 100644 --- a/tests/frustum.rs +++ b/tests/frustum.rs @@ -1,6 +1,3 @@ -extern crate cgmath; -extern crate collision; - use cgmath::{PerspectiveFov, Point3, Rad}; use collision::{Projection, Relation, Sphere}; diff --git a/tests/plane.rs b/tests/plane.rs index f120e70..672fd8b 100644 --- a/tests/plane.rs +++ b/tests/plane.rs @@ -1,8 +1,3 @@ -extern crate approx; - -extern crate cgmath; -extern crate collision; - use cgmath::*; use collision::*; diff --git a/tests/point.rs b/tests/point.rs index dff23a8..0214729 100644 --- a/tests/point.rs +++ b/tests/point.rs @@ -1,9 +1,4 @@ -#[macro_use] -extern crate approx; - -extern crate cgmath; -extern crate collision; - +use cgmath::assert_ulps_eq; use cgmath::{Point3, Vector3}; use collision::{Continuous, Plane, PlaneBound, Ray3, Relation}; diff --git a/tests/serde.rs b/tests/serde.rs index ea7bbc3..e426211 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -1,8 +1,5 @@ #![cfg(feature = "serde")] -extern crate cgmath; -extern crate serde; - use cgmath::Point1; use serde::Serialize; diff --git a/tests/sphere.rs b/tests/sphere.rs index a7f6357..307c6e8 100644 --- a/tests/sphere.rs +++ b/tests/sphere.rs @@ -1,8 +1,3 @@ -extern crate approx; - -extern crate cgmath; -extern crate collision; - use cgmath::*; use collision::*;