aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/narrow_phase.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2020-09-01 18:21:11 +0200
committerGitHub <noreply@github.com>2020-09-01 18:21:11 +0200
commitfef3a367d143bddde94e4f919a341cbf8d205293 (patch)
treec66a9aa0f8a4a0b6c54f069e291fa2f12cc16ea3 /src/geometry/narrow_phase.rs
parentcc05bad0410128b163e81e9f703ccb841f6a9a08 (diff)
parent763b9092422fd5677ffd47ec1b081951dc1c63e4 (diff)
downloadrapier-fef3a367d143bddde94e4f919a341cbf8d205293.tar.gz
rapier-fef3a367d143bddde94e4f919a341cbf8d205293.tar.bz2
rapier-fef3a367d143bddde94e4f919a341cbf8d205293.zip
Merge pull request #6 from dimforge/collider_removal
Add collider removal + fix rigid-bodies with multiple colliders
Diffstat (limited to 'src/geometry/narrow_phase.rs')
-rw-r--r--src/geometry/narrow_phase.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs
index 3eb2c30..1a36511 100644
--- a/src/geometry/narrow_phase.rs
+++ b/src/geometry/narrow_phase.rs
@@ -96,7 +96,7 @@ impl NarrowPhase {
}
// We have to manage the fact that one other collider will
- // hive its graph index changed because of the node's swap-remove.
+ // have its graph index changed because of the node's swap-remove.
if let Some(replacement) = self
.proximity_graph
.remove_node(proximity_graph_id)
@@ -129,6 +129,11 @@ impl NarrowPhase {
if let (Some(co1), Some(co2)) =
colliders.get2_mut_internal(pair.collider1, pair.collider2)
{
+ if co1.parent == co2.parent {
+ // Same parents. Ignore collisions.
+ continue;
+ }
+
if co1.is_sensor() || co2.is_sensor() {
let gid1 = co1.proximity_graph_index;
let gid2 = co2.proximity_graph_index;