diff --git a/crates/joltc-sys/JoltC b/crates/joltc-sys/JoltC index 2982004..e8029f8 160000 --- a/crates/joltc-sys/JoltC +++ b/crates/joltc-sys/JoltC @@ -1 +1 @@ -Subproject commit 2982004387a9e36ca89525a87d983709d3666da7 +Subproject commit e8029f8df36cd78643bb60336d91fee32abc704b diff --git a/crates/rolt/src/traits.rs b/crates/rolt/src/traits.rs index 7102d84..bc6fe33 100644 --- a/crates/rolt/src/traits.rs +++ b/crates/rolt/src/traits.rs @@ -392,7 +392,12 @@ impl BodyFilterBridge { /// See also: Jolt's [`ShapeFilter`](https://jrouwe.github.io/JoltPhysicsDocs/5.1.0/class_shape_filter.html) class. #[allow(unused)] pub trait ShapeFilter { - fn should_collide(&self, shape2: *const JPC_Shape, subshape_id2: JPC_SubShapeID) -> bool { + fn should_collide( + &self, + body: BodyId, + shape2: *const JPC_Shape, + subshape_id2: JPC_SubShapeID, + ) -> bool { true } @@ -400,6 +405,7 @@ pub trait ShapeFilter { &self, shape1: *const JPC_Shape, subshape_id1: JPC_SubShapeID, + body2: BodyId, shape2: *const JPC_Shape, subshape_id2: JPC_SubShapeID, ) -> bool { @@ -419,16 +425,19 @@ struct ShapeFilterBridge { impl ShapeFilterBridge { unsafe extern "C" fn ShouldCollide( this: *const c_void, + shape_filter: *const JPC_ShapeFilter, shape2: *const JPC_Shape, subshape_id2: JPC_SubShapeID, ) -> bool { let this = this.cast::().as_ref().unwrap(); - this.should_collide(shape2, subshape_id2) + let body_id = BodyId::new(JPC_ShapeFilter_getBodyID2(shape_filter)); + this.should_collide(body_id, shape2, subshape_id2) } unsafe extern "C" fn ShouldCollideTwoShapes( this: *const c_void, + shape_filter: *const JPC_ShapeFilter, shape1: *const JPC_Shape, subshape_id1: JPC_SubShapeID, shape2: *const JPC_Shape, @@ -436,7 +445,8 @@ impl ShapeFilterBridge { ) -> bool { let this = this.cast::().as_ref().unwrap(); - this.should_collide_two_shapes(shape1, subshape_id1, shape2, subshape_id2) + let body_id2 = BodyId::new(JPC_ShapeFilter_getBodyID2(shape_filter)); + this.should_collide_two_shapes(shape1, subshape_id1, body_id2, shape2, subshape_id2) } }