Removed camera.cullTilemap because nothing uses it any more

This commit is contained in:
Richard Davey 2018-04-09 16:00:33 +01:00
parent c2236e47eb
commit d15d910778

View file

@ -550,7 +550,7 @@ var Camera = new Class({
{
var object = renderableObjects[index];
if (!object.hasOwnProperty('width'))
if (!object.hasOwnProperty('width') || object.parentContainer)
{
culledObjects.push(object);
continue;
@ -628,7 +628,7 @@ var Camera = new Class({
{
var object = interactiveObjects[index].gameObject;
if (!object.hasOwnProperty('width'))
if (!object.hasOwnProperty('width') || object.parentContainer)
{
culledObjects.push(interactiveObjects[index]);
continue;
@ -655,73 +655,6 @@ var Camera = new Class({
return culledObjects;
},
/**
* [description]
*
* @method Phaser.Cameras.Scene2D.Camera#cullTilemap
* @since 3.0.0
*
* @param {Phaser.Tilemaps.Tilemap} tilemap - [description]
*
* @return {Phaser.GameObjects.GameObject[]} [description]
*/
cullTilemap: function (tilemap)
{
var cameraMatrix = this.matrix.matrix;
var mva = cameraMatrix[0];
var mvb = cameraMatrix[1];
var mvc = cameraMatrix[2];
var mvd = cameraMatrix[3];
/* First Invert Matrix */
var determinant = (mva * mvd) - (mvb * mvc);
var tiles = tilemap.tiles;
if (!determinant)
{
return tiles;
}
var mve = cameraMatrix[4];
var mvf = cameraMatrix[5];
var scrollX = this.scrollX;
var scrollY = this.scrollY;
var cameraW = this.width;
var cameraH = this.height;
var culledObjects = this.culledObjects;
var length = tiles.length;
var tileW = tilemap.tileWidth;
var tileH = tilemap.tileHeight;
var cullW = cameraW + tileW;
var cullH = cameraH + tileH;
var scrollFactorX = tilemap.scrollFactorX;
var scrollFactorY = tilemap.scrollFactorY;
determinant = 1 / determinant;
culledObjects.length = 0;
for (var index = 0; index < length; ++index)
{
var tile = tiles[index];
var tileX = (tile.x - (scrollX * scrollFactorX));
var tileY = (tile.y - (scrollY * scrollFactorY));
var tx = (tileX * mva + tileY * mvc + mve);
var ty = (tileX * mvb + tileY * mvd + mvf);
var tw = ((tileX + tileW) * mva + (tileY + tileH) * mvc + mve);
var th = ((tileX + tileW) * mvb + (tileY + tileH) * mvd + mvf);
if (tx > -tileW && ty > -tileH && tw < cullW && th < cullH)
{
culledObjects.push(tile);
}
}
return culledObjects;
},
/**
* Fades the Camera in from the given color over the duration specified.
*