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/interaction_graph.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/geometry/interaction_graph.rs') diff --git a/src/geometry/interaction_graph.rs b/src/geometry/interaction_graph.rs index 2abb6d1..cae8095 100644 --- a/src/geometry/interaction_graph.rs +++ b/src/geometry/interaction_graph.rs @@ -74,15 +74,9 @@ impl InteractionGraph { self.graph.node_weight(id).cloned() } - /// All the interactions pairs on this graph. - pub fn interaction_pairs(&self) -> impl Iterator { - self.graph.raw_edges().iter().map(move |edge| { - ( - self.graph[edge.source()], - self.graph[edge.target()], - &edge.weight, - ) - }) + /// All the interactions on this graph. + pub fn interactions(&self) -> impl Iterator { + self.graph.raw_edges().iter().map(move |edge| &edge.weight) } /// The interaction between the two collision objects identified by their graph index. -- cgit