Update the camera if dirty

This commit is contained in:
Richard Davey 2020-09-22 10:59:36 +01:00
parent d08a6c657c
commit 248d2352b6

View file

@ -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;
},
/**