aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/interaction_graph.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/geometry/interaction_graph.rs')
-rw-r--r--src/geometry/interaction_graph.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/geometry/interaction_graph.rs b/src/geometry/interaction_graph.rs
index cae8095..54a19ce 100644
--- a/src/geometry/interaction_graph.rs
+++ b/src/geometry/interaction_graph.rs
@@ -79,6 +79,19 @@ impl<T> InteractionGraph<T> {
self.graph.raw_edges().iter().map(move |edge| &edge.weight)
}
+ /// All the interactions on this graph with the corresponding endpoint weights.
+ pub fn interactions_with_endpoints(
+ &self,
+ ) -> impl Iterator<Item = (ColliderHandle, ColliderHandle, &T)> {
+ self.graph.raw_edges().iter().map(move |edge| {
+ (
+ self.graph.raw_nodes()[edge.source().index()].weight,
+ self.graph.raw_nodes()[edge.target().index()].weight,
+ &edge.weight,
+ )
+ })
+ }
+
/// The interaction between the two collision objects identified by their graph index.
pub fn interaction_pair(
&self,