aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2020-08-31 19:04:32 +0200
committerSébastien Crozet <developer@crozet.re>2020-08-31 19:05:14 +0200
commit03b437f278bbcbd391acd23a4d8fa074915eb00c (patch)
treec78bce0c49c60650a8548320baa61bae0f54239e
parentce26fe107727ee4ef25ee728b3bb3a40914fdc99 (diff)
downloadrapier-03b437f278bbcbd391acd23a4d8fa074915eb00c.tar.gz
rapier-03b437f278bbcbd391acd23a4d8fa074915eb00c.tar.bz2
rapier-03b437f278bbcbd391acd23a4d8fa074915eb00c.zip
Disallow contacts between two colliders attached to the same parent.
-rw-r--r--Cargo.toml7
-rw-r--r--examples3d/Cargo.toml2
-rw-r--r--src/geometry/narrow_phase.rs7
3 files changed, 14 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 32e6107..a766033 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,3 +10,10 @@ debug = false
codegen-units = 1
#opt-level = 1
#lto = true
+
+
+#[profile.dev.package.rapier3d]
+#opt-level = 3
+#
+#[profile.dev.package.kiss3d]
+#opt-level = 3 \ No newline at end of file
diff --git a/examples3d/Cargo.toml b/examples3d/Cargo.toml
index 3176696..8091db8 100644
--- a/examples3d/Cargo.toml
+++ b/examples3d/Cargo.toml
@@ -24,4 +24,4 @@ path = "../build/rapier3d"
[[bin]]
name = "all_examples3"
-path = "./all_examples3.rs" \ No newline at end of file
+path = "./all_examples3.rs"
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;