diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-10-27 17:14:13 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-10-27 17:17:14 +0100 |
| commit | 74f0297221607e1929db75e79089d7cb75558dfe (patch) | |
| tree | 446cbf59cf32a82a67ed889f0041ab886c5ace7e /src | |
| parent | 3bfa4079999f6c886e692de256abf51e4506a2b1 (diff) | |
| download | rapier-74f0297221607e1929db75e79089d7cb75558dfe.tar.gz rapier-74f0297221607e1929db75e79089d7cb75558dfe.tar.bz2 rapier-74f0297221607e1929db75e79089d7cb75558dfe.zip | |
Fix performance regression due to sleeping objects pairs no longer being ignored by the narrow-phase.
Diffstat (limited to 'src')
| -rw-r--r-- | src/geometry/narrow_phase.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs index 69678cd..c1bd411 100644 --- a/src/geometry/narrow_phase.rs +++ b/src/geometry/narrow_phase.rs @@ -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; } |
