mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +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
|
@ -30,6 +30,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++) {
|
||||
|
|
Loading…
Reference in a new issue