Fix bug with colliders without rigid bodies
- When `NarrowPhase` adds a collision pair, it checks to make sure that they don't have the same parent - In the case where the colliders have no parents (eg. they are not attached to a `RigidBody`) this yields a false positive. - The fix is to ensure that colliders have a parent before ignoring the pair.
This commit is contained in:
committed by
Sébastien Crozet
parent
1d55e841ec
commit
3f223aaf9e
@@ -571,8 +571,12 @@ impl NarrowPhase {
|
||||
let co_parent2: Option<&ColliderParent> = colliders.get(pair.collider2.0);
|
||||
|
||||
if co_parent1.map(|p| p.handle) == co_parent2.map(|p| p.handle) {
|
||||
// Same parents. Ignore collisions.
|
||||
return;
|
||||
if co_parent1.is_some() {
|
||||
// Same parents. Ignore collisions.
|
||||
return;
|
||||
}
|
||||
|
||||
// These colliders have no parents - continue.
|
||||
}
|
||||
|
||||
let (gid1, gid2) = self.graph_indices.ensure_pair_exists(
|
||||
|
||||
Reference in New Issue
Block a user