mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +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++) {
|
for (var i = 0; i < bodies.length; i++) {
|
||||||
var bodyA = bodies[i];
|
var bodyA = bodies[i];
|
||||||
|
|
||||||
|
// Phaser addition - skip same body checks
|
||||||
|
if (body === bodyA)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Bounds.overlaps(bodyA.bounds, body.bounds)) {
|
if (Bounds.overlaps(bodyA.bounds, body.bounds)) {
|
||||||
for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) {
|
for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue