Add methods to iterate through all the contact and proximity pairs.

This commit is contained in:
Crozet Sébastien
2020-11-24 16:39:09 +01:00
parent 437748096d
commit d98be2359d
2 changed files with 13 additions and 9 deletions

View File

@@ -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