Disallow contacts between two colliders attached to the same parent.
This commit is contained in:
@@ -10,3 +10,10 @@ debug = false
|
|||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
#opt-level = 1
|
#opt-level = 1
|
||||||
#lto = true
|
#lto = true
|
||||||
|
|
||||||
|
|
||||||
|
#[profile.dev.package.rapier3d]
|
||||||
|
#opt-level = 3
|
||||||
|
#
|
||||||
|
#[profile.dev.package.kiss3d]
|
||||||
|
#opt-level = 3
|
||||||
@@ -96,7 +96,7 @@ impl NarrowPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We have to manage the fact that one other collider will
|
// 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
|
if let Some(replacement) = self
|
||||||
.proximity_graph
|
.proximity_graph
|
||||||
.remove_node(proximity_graph_id)
|
.remove_node(proximity_graph_id)
|
||||||
@@ -129,6 +129,11 @@ impl NarrowPhase {
|
|||||||
if let (Some(co1), Some(co2)) =
|
if let (Some(co1), Some(co2)) =
|
||||||
colliders.get2_mut_internal(pair.collider1, pair.collider2)
|
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() {
|
if co1.is_sensor() || co2.is_sensor() {
|
||||||
let gid1 = co1.proximity_graph_index;
|
let gid1 = co1.proximity_graph_index;
|
||||||
let gid2 = co2.proximity_graph_index;
|
let gid2 = co2.proximity_graph_index;
|
||||||
|
|||||||
Reference in New Issue
Block a user