From 72fa4bd77fa8c3357194543fcfc0ed584c5ea665 Mon Sep 17 00:00:00 2001 From: Jef Date: Thu, 7 Jan 2021 10:34:25 +0100 Subject: [PATCH 1/2] Update to latest version of all dependencies --- Cargo.toml | 16 ++++++++-------- src/dbvt/mod.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9ca2d0d..a4c93bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,17 +32,17 @@ keywords = ["gamedev", "cgmath", "collision"] name = "collision" [dependencies] -rand = "0.6" -approx = "0.3" # Only for the macros; for all other instances use the re-exported cgmath ones. -cgmath = "0.17" +rand = "0.8" +approx = "0.4" # Only for the macros; for all other instances use the re-exported cgmath ones. +cgmath = "0.18" serde = { version = "1.0", optional = true, features = ["derive"] } bit-set = "0.5" -smallvec = "0.6.1" +smallvec = "1.6" +num = { version = "0.3", optional = true, features = ["serde"] } -[target.'cfg(feature="serde")'.dependencies] -cgmath = { version = "0.17", features = ["serde"] } -num = { version = "0.2", features = ["serde"] } +[features] +use-serde = ["serde", "cgmath/serde", "num"] [dev-dependencies] -genmesh = "0.5" +genmesh = "0.6" diff --git a/src/dbvt/mod.rs b/src/dbvt/mod.rs index f9c8167..c42dbcd 100644 --- a/src/dbvt/mod.rs +++ b/src/dbvt/mod.rs @@ -900,7 +900,7 @@ where // Only do rotations occasionally, as they are fairly expensive, and shouldn't be overused. // For most scenarios, the majority of shapes will not have moved, so this is fine. - if rand::thread_rng().gen_range(0, 100) < PERFORM_ROTATION_PERCENTAGE { + if rand::thread_rng().gen_range(0..100) < PERFORM_ROTATION_PERCENTAGE { self.rotate(node_index); } } From 95218b711af67b70b546549659738aef9f9030d6 Mon Sep 17 00:00:00 2001 From: Jef Date: Fri, 8 Jan 2021 11:18:23 +0100 Subject: [PATCH 2/2] Fix compilation errors/warnings in tests --- tests/bound.rs | 2 +- tests/dbvt.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bound.rs b/tests/bound.rs index f61c971..dd9ca43 100644 --- a/tests/bound.rs +++ b/tests/bound.rs @@ -2,7 +2,7 @@ extern crate collision; use collision::PlaneBound; -fn _box(_: Box>) {} +fn _box(_: Box>) {} #[test] fn bound_box() {} diff --git a/tests/dbvt.rs b/tests/dbvt.rs index 4ddcf72..fed8c3c 100644 --- a/tests/dbvt.rs +++ b/tests/dbvt.rs @@ -2,11 +2,11 @@ extern crate cgmath; extern crate collision; extern crate rand; -use cgmath::{Deg, PerspectiveFov, Point2, Point3, Vector2, Vector3}; use cgmath::prelude::*; -use collision::{Aabb2, Aabb3, Frustum, Projection, Ray2, Relation}; +use cgmath::{Deg, PerspectiveFov, Point2, Point3, Vector2, Vector3}; use collision::dbvt::*; use collision::prelude::*; +use collision::{Aabb2, Aabb3, Frustum, Projection, Ray2, Relation}; use rand::Rng; #[derive(Debug, Clone)] @@ -122,7 +122,7 @@ fn test_add_20() { let mut tree = DynamicBoundingVolumeTree::::new(); let mut rng = rand::thread_rng(); for i in 0..20 { - let offset = rng.gen_range(-10., 10.); + let offset = rng.gen_range(-10f32..10f32); tree.insert(Value2::new( i, aabb2(offset + 0.1, offset + 0.1, offset + 0.3, offset + 0.3),