From d98be2359df74a9844cd451c29e583c0c8ecb7d3 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Tue, 24 Nov 2020 16:39:09 +0100 Subject: Add methods to iterate through all the contact and proximity pairs. --- src/geometry/narrow_phase.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/geometry/narrow_phase.rs') 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 { + self.contact_graph.interactions() + } + + /// All the proximity pairs maintained by this narrow-phase. + pub fn proximity_pairs(&self) -> impl Iterator { + self.proximity_graph.interactions() + } + // #[cfg(feature = "parallel")] // pub(crate) fn contact_pairs_vec_mut(&mut self) -> &mut Vec { // &mut self.contact_graph.interactions -- cgit