Skip to content

Commit d955f75

Browse files
authored
Release v0.23.0 (#371)
* chore: update to nalgebra 0.34 * Release v0.23.0 * fix benches compilation
1 parent fed5077 commit d955f75

File tree

7 files changed

+47
-41
lines changed

7 files changed

+47
-41
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.23.0
2+
3+
- Update to nalgebra 0.34.
4+
15
## 0.22.1
26

37
### Added

crates/parry2d-f64/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "parry2d-f64"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55

66
description = "2 dimensional collision detection library in Rust. 64-bit precision version."
@@ -73,7 +73,7 @@ num-traits = { version = "0.2", default-features = false }
7373
slab = { version = "0.4", optional = true }
7474
arrayvec = { version = "0.7", default-features = false }
7575
simba = { version = "0.9", default-features = false }
76-
nalgebra = { version = "0.33", default-features = false, features = ["libm"] }
76+
nalgebra = { version = "0.34", default-features = false, features = ["libm"] }
7777
approx = { version = "0.5", default-features = false }
7878
serde = { version = "1.0", optional = true, features = ["derive"] }
7979
rkyv = { version = "0.7.41", optional = true }
@@ -95,4 +95,4 @@ smallvec = "1"
9595
simba = { version = "0.9", default-features = false }
9696
oorandom = "11"
9797
ptree = "0.4.0"
98-
rand = { version = "0.8" }
98+
rand = { version = "0.9" }

crates/parry2d/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "parry2d"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55

66
description = "2 dimensional collision detection library in Rust."
@@ -73,7 +73,7 @@ num-traits = { version = "0.2", default-features = false }
7373
slab = { version = "0.4", optional = true }
7474
arrayvec = { version = "0.7", default-features = false }
7575
simba = { version = "0.9", default-features = false }
76-
nalgebra = { version = "0.33", default-features = false, features = ["libm"] }
76+
nalgebra = { version = "0.34", default-features = false, features = ["libm"] }
7777
approx = { version = "0.5", default-features = false }
7878
serde = { version = "1.0", optional = true, features = ["derive"] }
7979
rkyv = { version = "0.7.41", optional = true }
@@ -95,7 +95,7 @@ smallvec = "1"
9595
simba = { version = "0.9", default-features = false }
9696
oorandom = "11"
9797
ptree = "0.4.0"
98-
rand = { version = "0.8" }
98+
rand = { version = "0.9" }
9999
macroquad = "0.4.12"
100100

101101
[package.metadata.docs.rs]

crates/parry3d-f64/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "parry3d-f64"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55

66
description = "3 dimensional collision detection library in Rust. 64-bits precision version."
@@ -73,7 +73,7 @@ num-traits = { version = "0.2", default-features = false }
7373
slab = { version = "0.4", optional = true }
7474
arrayvec = { version = "0.7", default-features = false }
7575
simba = { version = "0.9", default-features = false }
76-
nalgebra = { version = "0.33", default-features = false, features = ["libm"] }
76+
nalgebra = { version = "0.34", default-features = false, features = ["libm"] }
7777
approx = { version = "0.5", default-features = false }
7878
serde = { version = "1.0", optional = true, features = ["derive", "rc"] }
7979
rkyv = { version = "0.7.41", optional = true }
@@ -98,7 +98,7 @@ thiserror = { version = "2", default-features = false }
9898
[dev-dependencies]
9999
oorandom = "11"
100100
ptree = "0.4.0"
101-
rand = { version = "0.8" }
101+
rand = { version = "0.9" }
102102

103103
[package.metadata.docs.rs]
104104
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]

crates/parry3d/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "parry3d"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55

66
description = "3 dimensional collision detection library in Rust."
@@ -74,7 +74,7 @@ num-traits = { version = "0.2", default-features = false }
7474
slab = { version = "0.4", optional = true }
7575
arrayvec = { version = "0.7", default-features = false }
7676
simba = { version = "0.9", default-features = false }
77-
nalgebra = { version = "0.33", default-features = false, features = ["libm"] }
77+
nalgebra = { version = "0.34", default-features = false, features = ["libm"] }
7878
approx = { version = "0.5", default-features = false }
7979
serde = { version = "1.0", optional = true, features = ["derive", "rc"] }
8080
rkyv = { version = "0.7.41", optional = true }
@@ -103,10 +103,10 @@ glam = { version = "0.30.4", optional = true }
103103
[dev-dependencies]
104104
oorandom = "11"
105105
ptree = "0.4.0"
106-
rand = { version = "0.8" }
106+
rand = { version = "0.9" }
107107
macroquad = "0.4.12"
108-
nalgebra = { version = "0.33", default-features = false, features = ["rand"] }
109-
rand_isaac = "0.3"
108+
nalgebra = { version = "0.34", default-features = false, features = ["rand"] }
109+
rand_isaac = "0.4"
110110

111111
[package.metadata.docs.rs]
112112
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]

crates/parry3d/benches/common/default_gen.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use parry3d::math::{Point, Real, Vector};
77
use parry3d::query::Ray;
88
use parry3d::shape::ConvexPolyhedron;
99
use parry3d::shape::{Ball, Capsule, Cone, Cuboid, Cylinder, Segment, Triangle};
10-
use rand::distributions::{Distribution, Standard};
10+
use rand::distr::{Distribution, StandardUniform};
1111
use rand::Rng;
1212

1313
pub trait DefaultGen {
@@ -22,7 +22,7 @@ macro_rules! impl_rand_default_gen (
2222
($t: ty) => {
2323
impl DefaultGen for $t {
2424
fn generate<R: Rng>(rng: &mut R) -> $t {
25-
rng.gen::<$t>()
25+
rng.random::<$t>()
2626
}
2727
}
2828
}
@@ -56,101 +56,101 @@ impl_rand_default_gen!(bool);
5656

5757
impl DefaultGen for Ball
5858
where
59-
Standard: Distribution<Real>,
59+
StandardUniform: Distribution<Real>,
6060
{
6161
fn generate<R: Rng>(rng: &mut R) -> Ball {
62-
Ball::new(rng.gen::<f32>().abs())
62+
Ball::new(rng.random::<f32>().abs())
6363
}
6464
}
6565

6666
impl DefaultGen for Cuboid
6767
where
68-
Standard: Distribution<Vector<Real>>,
68+
StandardUniform: Distribution<Vector<Real>>,
6969
{
7070
fn generate<R: Rng>(rng: &mut R) -> Cuboid {
71-
Cuboid::new(rng.gen::<Vector<Real>>().abs())
71+
Cuboid::new(rng.random::<Vector<Real>>().abs())
7272
}
7373
}
7474

7575
impl DefaultGen for Capsule
7676
where
77-
Standard: Distribution<Real>,
77+
StandardUniform: Distribution<Real>,
7878
{
7979
fn generate<R: Rng>(rng: &mut R) -> Capsule {
8080
Capsule::new(
81-
rng.gen::<Point<Real>>(),
82-
rng.gen::<Point<Real>>(),
83-
rng.gen::<Real>().abs(),
81+
rng.random::<Point<Real>>(),
82+
rng.random::<Point<Real>>(),
83+
rng.random::<Real>().abs(),
8484
)
8585
}
8686
}
8787

8888
impl DefaultGen for Cone
8989
where
90-
Standard: Distribution<Real>,
90+
StandardUniform: Distribution<Real>,
9191
{
9292
fn generate<R: Rng>(rng: &mut R) -> Cone {
93-
Cone::new(rng.gen::<Real>().abs(), rng.gen::<Real>().abs())
93+
Cone::new(rng.random::<Real>().abs(), rng.random::<Real>().abs())
9494
}
9595
}
9696

9797
impl DefaultGen for Cylinder
9898
where
99-
Standard: Distribution<Real>,
99+
StandardUniform: Distribution<Real>,
100100
{
101101
fn generate<R: Rng>(rng: &mut R) -> Cylinder {
102-
Cylinder::new(rng.gen::<Real>().abs(), rng.gen::<Real>().abs())
102+
Cylinder::new(rng.random::<Real>().abs(), rng.random::<Real>().abs())
103103
}
104104
}
105105

106106
impl DefaultGen for Segment
107107
where
108-
Standard: Distribution<Point<Real>>,
108+
StandardUniform: Distribution<Point<Real>>,
109109
{
110110
fn generate<R: Rng>(rng: &mut R) -> Segment {
111-
Segment::new(rng.gen(), rng.gen())
111+
Segment::new(rng.random(), rng.random())
112112
}
113113
}
114114

115115
impl DefaultGen for Triangle
116116
where
117-
Standard: Distribution<Point<Real>>,
117+
StandardUniform: Distribution<Point<Real>>,
118118
{
119119
fn generate<R: Rng>(rng: &mut R) -> Triangle {
120-
Triangle::new(rng.gen(), rng.gen(), rng.gen())
120+
Triangle::new(rng.random(), rng.random(), rng.random())
121121
}
122122
}
123123

124124
impl DefaultGen for ConvexPolyhedron
125125
where
126-
Standard: Distribution<Real>,
126+
StandardUniform: Distribution<Real>,
127127
{
128128
fn generate<R: Rng>(rng: &mut R) -> ConvexPolyhedron {
129129
// It is recommended to have at most 100 points.
130130
// Otherwise, a smarter structure like the DK hierarchy would be needed.
131-
let pts: Vec<_> = (0..100).map(|_| rng.gen()).collect();
131+
let pts: Vec<_> = (0..100).map(|_| rng.random()).collect();
132132
ConvexPolyhedron::from_convex_hull(&pts).unwrap()
133133
}
134134
}
135135

136136
impl DefaultGen for Ray
137137
where
138-
Standard: Distribution<Vector<Real>>,
138+
StandardUniform: Distribution<Vector<Real>>,
139139
{
140140
fn generate<R: Rng>(rng: &mut R) -> Ray {
141141
// The generate ray will always point to the origin.
142-
let shift = rng.gen::<Vector<Real>>() * na::convert::<_, Real>(10.0f64);
142+
let shift = rng.random::<Vector<Real>>() * na::convert::<_, Real>(10.0f64);
143143
Ray::new(Point::origin() + shift, -shift)
144144
}
145145
}
146146

147147
impl DefaultGen for Aabb
148148
where
149-
Standard: Distribution<Vector<Real>>,
149+
StandardUniform: Distribution<Vector<Real>>,
150150
{
151151
fn generate<R: Rng>(rng: &mut R) -> Aabb {
152152
// an Aabb centered at the origin.
153-
let half_extents = rng.gen::<Vector<Real>>().abs();
153+
let half_extents = rng.random::<Vector<Real>>().abs();
154154
Aabb::new(
155155
Point::origin() + (-half_extents),
156156
Point::origin() + half_extents,
@@ -160,10 +160,10 @@ where
160160

161161
impl DefaultGen for BoundingSphere
162162
where
163-
Standard: Distribution<Real>,
163+
StandardUniform: Distribution<Real>,
164164
{
165165
fn generate<R: Rng>(rng: &mut R) -> BoundingSphere {
166166
// a bounding sphere centered at the origin.
167-
BoundingSphere::new(Point::origin(), rng.gen::<Real>().abs())
167+
BoundingSphere::new(Point::origin(), rng.random::<Real>().abs())
168168
}
169169
}

crates/parry3d/benches/common/generators.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use parry3d::shape::TriMesh;
33
use rand::Rng;
44

55
pub fn generate_trimesh_around_origin<R: Rng>(rng: &mut R) -> TriMesh {
6-
let pts = (0..3000).map(|_| rng.gen::<Point3<f32>>() * 3.0).collect();
6+
let pts = (0..3000)
7+
.map(|_| rng.random::<Point3<f32>>() * 3.0)
8+
.collect();
79
let indices = (0..1000).map(|i| [i * 3, i * 3 + 1, i * 3 + 2]).collect();
810

911
TriMesh::new(pts, indices).unwrap()

0 commit comments

Comments
 (0)