aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/interaction_graph.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2020-12-17 13:23:00 +0100
committerCrozet Sébastien <developer@crozet.re>2020-12-29 11:31:59 +0100
commit29717c2887b2db39faf9c25053730b661dc5da2b (patch)
treed7ec5abf85af4b3519ead56891dda23e02c08323 /src/geometry/interaction_graph.rs
parente231bacec608fa5efd24f7a876572927dbd6c9c4 (diff)
downloadrapier-29717c2887b2db39faf9c25053730b661dc5da2b.tar.gz
rapier-29717c2887b2db39faf9c25053730b661dc5da2b.tar.bz2
rapier-29717c2887b2db39faf9c25053730b661dc5da2b.zip
Externalize the proximity code (renamed intersection).
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,