diff --git a/src/collision/Detector.js b/src/collision/Detector.js index 041ccbde..f7cb2884 100644 --- a/src/collision/Detector.js +++ b/src/collision/Detector.js @@ -31,7 +31,7 @@ var Bounds = require('../geometry/Bounds'); var bodyA = broadphasePairs[i][0], bodyB = broadphasePairs[i][1]; - if ((bodyA.isStatic || bodyA.isSleeping) && (bodyB.isStatic || bodyB.isSleeping)) + if (bodyA.isSleeping && bodyB.isSleeping) continue; if (!Detector.canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) diff --git a/src/collision/Grid.js b/src/collision/Grid.js index 55b62efd..ca58a1d5 100644 --- a/src/collision/Grid.js +++ b/src/collision/Grid.js @@ -231,7 +231,10 @@ var Common = require('../core/Common'); for (var i = 0; i < bucket.length; i++) { var bodyB = bucket[i]; - if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic)) + if (body.id === bodyB.id) + continue; + + if (body.isStatic && bodyB.isStatic && !(body.isSensor || bodyB.isSensor)) continue; // keep track of the number of buckets the pair exists in