mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
QuadTree leveling Bug
Rather than level++ which changes the current node's level, the subnodes should get the current node's level + 1
This commit is contained in:
parent
ff5dda7e82
commit
2be45e93ae
1 changed files with 4 additions and 6 deletions
|
@ -171,19 +171,17 @@ Phaser.QuadTree.prototype = {
|
|||
*/
|
||||
split: function () {
|
||||
|
||||
this.level++;
|
||||
|
||||
// top right node
|
||||
this.nodes[0] = new Phaser.QuadTree(this.bounds.right, this.bounds.y, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, this.level);
|
||||
this.nodes[0] = new Phaser.QuadTree(this.bounds.right, this.bounds.y, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, (this.level + 1));
|
||||
|
||||
// top left node
|
||||
this.nodes[1] = new Phaser.QuadTree(this.bounds.x, this.bounds.y, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, this.level);
|
||||
this.nodes[1] = new Phaser.QuadTree(this.bounds.x, this.bounds.y, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, (this.level + 1));
|
||||
|
||||
// bottom left node
|
||||
this.nodes[2] = new Phaser.QuadTree(this.bounds.x, this.bounds.bottom, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, this.level);
|
||||
this.nodes[2] = new Phaser.QuadTree(this.bounds.x, this.bounds.bottom, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, (this.level + 1));
|
||||
|
||||
// bottom right node
|
||||
this.nodes[3] = new Phaser.QuadTree(this.bounds.right, this.bounds.bottom, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, this.level);
|
||||
this.nodes[3] = new Phaser.QuadTree(this.bounds.right, this.bounds.bottom, this.bounds.subWidth, this.bounds.subHeight, this.maxObjects, this.maxLevels, (this.level + 1));
|
||||
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue