diff options
| author | Sébastien Crozet <developer@crozet.re> | 2020-11-24 16:54:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-24 16:54:15 +0100 |
| commit | bdf2e15fdcff4c4757b4875354b2d6e8b9c6939d (patch) | |
| tree | 097166c76d92921b269b28a1e115b3cef89d820b /src/geometry/interaction_graph.rs | |
| parent | c641114f016c47f6b22acc084610847f88ff5a66 (diff) | |
| parent | fcafcac66f1792ea155925e3de5055ef50910fb0 (diff) | |
| download | rapier-bdf2e15fdcff4c4757b4875354b2d6e8b9c6939d.tar.gz rapier-bdf2e15fdcff4c4757b4875354b2d6e8b9c6939d.tar.bz2 rapier-bdf2e15fdcff4c4757b4875354b2d6e8b9c6939d.zip | |
Merge pull request #68 from dimforge/read_contacts
Allow access to contact information
Diffstat (limited to 'src/geometry/interaction_graph.rs')
| -rw-r--r-- | src/geometry/interaction_graph.rs | 12 |
1 files changed, 3 insertions, 9 deletions
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<T> InteractionGraph<T> { self.graph.node_weight(id).cloned() } - /// All the interactions pairs on this graph. - pub fn interaction_pairs(&self) -> impl Iterator<Item = (ColliderHandle, ColliderHandle, &T)> { - 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<Item = &T> { + self.graph.raw_edges().iter().map(move |edge| &edge.weight) } /// The interaction between the two collision objects identified by their graph index. |
