mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 22:52:14 +00:00
Skip matching a body against itself
This commit is contained in:
parent
9b8ce1b8e3
commit
59749ab519
1 changed files with 6 additions and 0 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue