mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Update the camera if dirty
This commit is contained in:
parent
d08a6c657c
commit
248d2352b6
1 changed files with 7 additions and 3 deletions
|
@ -503,15 +503,16 @@ var Layer3D = new Class({
|
|||
|
||||
var camera = this.camera;
|
||||
|
||||
if (camera.dirty || width !== this._prevWidth || height !== this._prevHeight)
|
||||
if (camera.dirtyProjection || width !== this._prevWidth || height !== this._prevHeight)
|
||||
{
|
||||
// Mesh has resized, flow that down to the Camera
|
||||
camera.update(width, height);
|
||||
camera.updateProjectionMatrix(width, height);
|
||||
|
||||
this._prevWidth = width;
|
||||
this._prevHeight = height;
|
||||
}
|
||||
|
||||
camera.update();
|
||||
|
||||
var models = this.models;
|
||||
|
||||
for (var i = 0; i < models.length; i++)
|
||||
|
@ -523,6 +524,9 @@ var Layer3D = new Class({
|
|||
model.preUpdate(time, delta);
|
||||
}
|
||||
}
|
||||
|
||||
camera.dirtyView = false;
|
||||
camera.dirtyProjection = false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue