diff options
| author | Sébastien Crozet <developer@crozet.re> | 2021-02-18 13:53:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-18 13:53:05 +0100 |
| commit | 9a15838ad568958273218b678ac22e53bb0a0842 (patch) | |
| tree | 84a5f873d24299bbd003b0f43804f80eca6a8aa3 /src | |
| parent | 12c5dd4caa6af5750b682ba17229601e3a418155 (diff) | |
| parent | f2d9225101843207188e554a14649f34870380ef (diff) | |
| download | rapier-9a15838ad568958273218b678ac22e53bb0a0842.tar.gz rapier-9a15838ad568958273218b678ac22e53bb0a0842.tar.bz2 rapier-9a15838ad568958273218b678ac22e53bb0a0842.zip | |
Merge pull request #118 from EmbarkStudios/collider-handles-in-filter
Add ColliderHandle:s to PairFilterContext
Diffstat (limited to 'src')
| -rw-r--r-- | src/geometry/narrow_phase.rs | 4 | ||||
| -rw-r--r-- | src/geometry/pair_filter.rs | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs index 7525a68..640ce12 100644 --- a/src/geometry/narrow_phase.rs +++ b/src/geometry/narrow_phase.rs @@ -424,6 +424,8 @@ impl NarrowPhase { let context = PairFilterContext { rigid_body1: rb1, rigid_body2: rb2, + collider_handle1: handle1, + collider_handle2: handle2, collider1: co1, collider2: co2, }; @@ -492,6 +494,8 @@ impl NarrowPhase { let context = PairFilterContext { rigid_body1: rb1, rigid_body2: rb2, + collider_handle1: pair.pair.collider1, + collider_handle2: pair.pair.collider2, collider1: co1, collider2: co2, }; diff --git a/src/geometry/pair_filter.rs b/src/geometry/pair_filter.rs index 944de47..25f300f 100644 --- a/src/geometry/pair_filter.rs +++ b/src/geometry/pair_filter.rs @@ -1,5 +1,5 @@ use crate::dynamics::RigidBody; -use crate::geometry::{Collider, SolverFlags}; +use crate::geometry::{Collider, ColliderHandle, SolverFlags}; /// Context given to custom collision filters to filter-out collisions. pub struct PairFilterContext<'a> { @@ -8,6 +8,10 @@ pub struct PairFilterContext<'a> { /// The first collider involved in the potential collision. pub rigid_body2: &'a RigidBody, /// The first collider involved in the potential collision. + pub collider_handle1: ColliderHandle, + /// The first collider involved in the potential collision. + pub collider_handle2: ColliderHandle, + /// The first collider involved in the potential collision. pub collider1: &'a Collider, /// The first collider involved in the potential collision. pub collider2: &'a Collider, |
