Fix performance regression due to sleeping objects pairs no longer being ignored by the narrow-phase.

This commit is contained in:
Crozet Sébastien
2020-10-27 17:14:13 +01:00
parent 3bfa407999
commit 74f0297221

View File

@@ -303,7 +303,10 @@ impl NarrowPhase {
let rb1 = &bodies[co1.parent];
let rb2 = &bodies[co2.parent];
if (rb1.is_sleeping() && rb2.is_static()) || (rb2.is_sleeping() && rb1.is_static()) {
if (rb1.is_sleeping() && rb2.is_static())
|| (rb2.is_sleeping() && rb1.is_static())
|| (rb1.is_sleeping() && rb2.is_sleeping())
{
// No need to update this proximity because nothing moved.
return;
}
@@ -374,7 +377,10 @@ impl NarrowPhase {
let rb1 = &bodies[co1.parent];
let rb2 = &bodies[co2.parent];
if (rb1.is_sleeping() && rb2.is_static()) || (rb2.is_sleeping() && rb1.is_static()) {
if (rb1.is_sleeping() && rb2.is_static())
|| (rb2.is_sleeping() && rb1.is_static())
|| (rb1.is_sleeping() && rb2.is_sleeping())
{
// No need to update this contact because nothing moved.
return;
}