Skip to content

Commit 8234e6d

Browse files
chore(deps): bump rapier2d to 0.19.0 (#1051)
The forked version wasn't working for me when building in a sandbox, so I've bumped it to the upstream one that contained the fix. Signed-off-by: Marcin Serwin <[email protected]>
1 parent 79fcfe8 commit 8234e6d

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

Cargo.lock

Lines changed: 19 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ tracing = "0.1.37"
2424
puffin = { version = "0.17.0", features = ["web"] }
2525
puffin_egui = "0.23.0"
2626
petgraph = "0.6.4"
27-
# Use rapier w/ parry2d 0.13.7 for qbvh crash fix: https://github.com/dimforge/parry/pull/185
28-
rapier2d = { git = "https://github.com/MaxCWhitehead/rapier.git", rev = "29c72c6c282e7c40987c0d0d0ce3089ea019a532", features = [
27+
rapier2d = { version = "0.19.0", features = [
2928
"debug-render",
3029
"enhanced-determinism",
3130
] }

src/core/physics/collisions.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use indexmap::IndexMap;
66

77
use rapier::Vector;
88
use rapier2d::geometry::InteractionGroups;
9+
use rapier2d::parry::query::ShapeCastOptions;
910
pub use rapier2d::prelude as rapier;
1011
pub use shape::*;
1112

@@ -1118,8 +1119,7 @@ impl<'a> CollisionWorld<'a> {
11181119
&position,
11191120
&velocity,
11201121
&**shape,
1121-
1.0,
1122-
true,
1122+
ShapeCastOptions::with_max_time_of_impact(1.0),
11231123
rapier::QueryFilter::new().predicate(&|_handle, rapier_collider| {
11241124
let ent = RapierUserData::entity(rapier_collider.user_data);
11251125

@@ -1142,7 +1142,7 @@ impl<'a> CollisionWorld<'a> {
11421142
let ent = RapierUserData::entity(collider_set.get(handle).unwrap().user_data);
11431143

11441144
// Move up to the point of collision
1145-
let diff = dy * toi.toi;
1145+
let diff = dy * toi.time_of_impact;
11461146
movement += diff;
11471147
position.translation.y += diff;
11481148

@@ -1258,8 +1258,7 @@ impl<'a> CollisionWorld<'a> {
12581258
&position,
12591259
&velocity,
12601260
&**shape,
1261-
1.0,
1262-
true,
1261+
ShapeCastOptions::with_max_time_of_impact(1.0),
12631262
rapier::QueryFilter::new().predicate(&|_handle, rapier_collider| {
12641263
let ent = RapierUserData::entity(rapier_collider.user_data);
12651264

@@ -1283,7 +1282,7 @@ impl<'a> CollisionWorld<'a> {
12831282
let ent = RapierUserData::entity(collider_set.get(handle).unwrap().user_data);
12841283

12851284
// Move up to the point of collision
1286-
let diff = dx * toi.toi;
1285+
let diff = dx * toi.time_of_impact;
12871286
movement += diff;
12881287
position.translation.x += diff;
12891288

0 commit comments

Comments
 (0)