aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/narrow_phase.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2020-11-24 16:39:09 +0100
committerCrozet Sébastien <developer@crozet.re>2020-11-24 16:39:09 +0100
commitd98be2359df74a9844cd451c29e583c0c8ecb7d3 (patch)
tree43b715daada2eb5372f53cd83d474f1464bb47f5 /src/geometry/narrow_phase.rs
parent437748096d96d4bde5540711580be26a2b146b65 (diff)
downloadrapier-d98be2359df74a9844cd451c29e583c0c8ecb7d3.tar.gz
rapier-d98be2359df74a9844cd451c29e583c0c8ecb7d3.tar.bz2
rapier-d98be2359df74a9844cd451c29e583c0c8ecb7d3.zip
Add methods to iterate through all the contact and proximity pairs.
Diffstat (limited to 'src/geometry/narrow_phase.rs')
-rw-r--r--src/geometry/narrow_phase.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs
index a3d0ea7..a21d3c6 100644
--- a/src/geometry/narrow_phase.rs
+++ b/src/geometry/narrow_phase.rs
@@ -140,6 +140,16 @@ impl NarrowPhase {
.map(|c| c.2)
}
+ /// All the contact pairs maintained by this narrow-phase.
+ pub fn contact_pairs(&self) -> impl Iterator<Item = &ContactPair> {
+ self.contact_graph.interactions()
+ }
+
+ /// All the proximity pairs maintained by this narrow-phase.
+ pub fn proximity_pairs(&self) -> impl Iterator<Item = &ProximityPair> {
+ self.proximity_graph.interactions()
+ }
+
// #[cfg(feature = "parallel")]
// pub(crate) fn contact_pairs_vec_mut(&mut self) -> &mut Vec<ContactPair> {
// &mut self.contact_graph.interactions