Skip matching a body against itself

This commit is contained in:
Richard Davey 2019-12-04 03:12:46 +00:00
parent 9b8ce1b8e3
commit 59749ab519

View file

@ -31,6 +31,12 @@ var Vertices = require('../geometry/Vertices');
for (var i = 0; i < bodies.length; i++) {
var bodyA = bodies[i];
// Phaser addition - skip same body checks
if (body === bodyA)
{
continue;
}
if (Bounds.overlaps(bodyA.bounds, body.bounds)) {
for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) {
var part = bodyA.parts[j];