Skip to content

Commit 317322b

Browse files
authored
feat: reduce the amount of duplicate work the broad-phase is doing for user changes and CCD + release v0.28.0 (#872)
* feat: reduce the amount of duplicate work the broad-phase is doing for user changes and CCD * Release v0.28.0 * chore: fix warnings * chore: clippy fixes * chore: more clippy fixes
1 parent 038eb34 commit 317322b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+351
-328
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## v0.28.0 (08 August 2025)
2+
3+
### Modified
4+
5+
- Update to nalgebra 0.34 and parry 0.23.
6+
- Only run the broad-phase once at the beginning of the physics step.
7+
- Don’t rebuild a BVH from scratch for CCD. Instead, reuse the broad-phase bvh with localized changes.
8+
- The public methods of `IslandSolver` has changed slightly to take the broad-phase as input.
9+
- Removed the `BroadPhase` trait and use the BVH broad-phase directly instead of a trait-object.
10+
11+
### Added
12+
13+
- Add `Collider::compute_broad_phase_aabb` to compute the AABB to be used by the broad-phase, taking
14+
into account its contact skin, prediction, and soft-ccd.
15+
16+
### Fix
17+
18+
- Fix issue where some solver contacts would disappear from the contact graph before the user
19+
had a chance to read them.
20+
121
## v0.27.0 (24 July 2025)
222

323
### Modified

benchmarks2d/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ other-backends = ["rapier_testbed2d/other-backends"]
1212
enhanced-determinism = ["rapier2d/enhanced-determinism"]
1313

1414
[dependencies]
15-
rand = "0.8"
15+
rand = "0.9"
1616
Inflector = "0.11"
1717

1818
[dependencies.rapier_testbed2d]

benchmarks2d/convex_polygons2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rand::distributions::{Distribution, Standard};
1+
use rand::distr::{Distribution, StandardUniform};
22
use rand::{SeedableRng, rngs::StdRng};
33
use rapier_testbed2d::Testbed;
44
use rapier2d::prelude::*;
@@ -48,7 +48,7 @@ pub fn init_world(testbed: &mut Testbed) {
4848
let centery = shift / 2.0;
4949

5050
let mut rng = StdRng::seed_from_u64(0);
51-
let distribution = Standard;
51+
let distribution = StandardUniform;
5252

5353
for i in 0..num {
5454
for j in 0usize..num * 5 {

benchmarks3d/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ other-backends = ["rapier_testbed3d/other-backends"]
1212
enhanced-determinism = ["rapier3d/enhanced-determinism"]
1313

1414
[dependencies]
15-
rand = "0.8"
15+
rand = "0.9"
1616
Inflector = "0.11"
1717
oorandom = "11"
1818

benchmarks3d/convex_polyhedron3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rand::distributions::{Distribution, Standard};
1+
use rand::distr::{Distribution, StandardUniform};
22
use rand::{SeedableRng, rngs::StdRng};
33
use rapier_testbed3d::Testbed;
44
use rapier3d::prelude::*;
@@ -39,7 +39,7 @@ pub fn init_world(testbed: &mut Testbed) {
3939
let mut offset = -(num as f32) * shift * 0.5;
4040

4141
let mut rng = StdRng::seed_from_u64(0);
42-
let distribution = Standard;
42+
let distribution = StandardUniform;
4343

4444
for j in 0usize..47 {
4545
for i in 0..num {

benchmarks3d/ray_cast3.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ pub fn init_world(testbed: &mut Testbed) {
5151
let t1 = std::time::Instant::now();
5252
let max_toi = ray_ball_radius - 1.0;
5353

54-
let Some(broad_phase) = physics.broad_phase.downcast_ref::<BroadPhaseBvh>() else {
55-
return;
56-
};
57-
let query_pipeline = broad_phase.as_query_pipeline(
54+
let query_pipeline = physics.broad_phase.as_query_pipeline(
5855
physics.narrow_phase.query_dispatcher(),
5956
&physics.bodies,
6057
&physics.colliders,

crates/rapier2d-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 = "rapier2d-f64"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "2-dimensional physics engine in Rust."
66
documentation = "https://docs.rs/rapier2d"
@@ -68,8 +68,8 @@ required-features = ["dim2", "f64"]
6868
vec_map = { version = "0.8", optional = true }
6969
web-time = { version = "1.1", optional = true }
7070
num-traits = "0.2"
71-
nalgebra = "0.33"
72-
parry2d-f64 = "0.22.0"
71+
nalgebra = "0.34"
72+
parry2d-f64 = "0.23.0"
7373
simba = "0.9"
7474
approx = "0.5"
7575
rayon = { version = "1", optional = true }

crates/rapier2d/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rapier2d"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "2-dimensional physics engine in Rust."
66
documentation = "https://docs.rs/rapier2d"
@@ -69,8 +69,8 @@ required-features = ["dim2", "f32"]
6969
vec_map = { version = "0.8", optional = true }
7070
web-time = { version = "1.1", optional = true }
7171
num-traits = "0.2"
72-
nalgebra = "0.33"
73-
parry2d = "0.22.0"
72+
nalgebra = "0.34"
73+
parry2d = "0.23.0"
7474
simba = "0.9"
7575
approx = "0.5"
7676
rayon = { version = "1", optional = true }

crates/rapier3d-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 = "rapier3d-f64"
3-
version = "0.27.0"
3+
version = "0.28.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "3-dimensional physics engine in Rust."
66
documentation = "https://docs.rs/rapier3d"
@@ -71,8 +71,8 @@ required-features = ["dim3", "f64"]
7171
vec_map = { version = "0.8", optional = true }
7272
web-time = { version = "1.1", optional = true }
7373
num-traits = "0.2"
74-
nalgebra = "0.33"
75-
parry3d-f64 = "0.22.0"
74+
nalgebra = "0.34"
75+
parry3d-f64 = "0.23.0"
7676
simba = "0.9"
7777
approx = "0.5"
7878
rayon = { version = "1", optional = true }

crates/rapier3d-meshloader/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rapier3d-meshloader"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Sébastien Crozet <[email protected]>"]
55
description = "STL file loader for the 3D rapier physics engine."
66
documentation = "https://docs.rs/rapier3d-meshloader"
@@ -29,4 +29,4 @@ thiserror = "2"
2929
profiling = "1.0"
3030
mesh-loader = "0.1.12"
3131

32-
rapier3d = { version = "0.27.0", path = "../rapier3d" }
32+
rapier3d = { version = "0.28.0", path = "../rapier3d" }

0 commit comments

Comments
 (0)