Skip to content

Commit 248d235

Browse files
committed
Update the camera if dirty
1 parent d08a6c6 commit 248d235

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/gameobjects/layer3d/Layer3D.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,16 @@ var Layer3D = new Class({
503503

504504
var camera = this.camera;
505505

506-
if (camera.dirty || width !== this._prevWidth || height !== this._prevHeight)
506+
if (camera.dirtyProjection || width !== this._prevWidth || height !== this._prevHeight)
507507
{
508-
// Mesh has resized, flow that down to the Camera
509-
camera.update(width, height);
508+
camera.updateProjectionMatrix(width, height);
510509

511510
this._prevWidth = width;
512511
this._prevHeight = height;
513512
}
514513

514+
camera.update();
515+
515516
var models = this.models;
516517

517518
for (var i = 0; i < models.length; i++)
@@ -523,6 +524,9 @@ var Layer3D = new Class({
523524
model.preUpdate(time, delta);
524525
}
525526
}
527+
528+
camera.dirtyView = false;
529+
camera.dirtyProjection = false;
526530
},
527531

528532
/**

0 commit comments

Comments
 (0)