Skip to content

Commit

Permalink
refactor(Camera): remove matrixProjectionNeedsUpdate.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Jan 27, 2021
1 parent 596cee6 commit a501c92
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions src/Controls/PlanarControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ class PlanarControls extends THREE.EventDispatcher {
// current world coordinates under the mouse
this.view.viewToNormalizedCoords(mousePosition, vect);
vect.z = 0;
this.camera.updateProjectionMatrix();
vect.unproject(this.camera);

// new camera position
Expand Down Expand Up @@ -754,7 +753,7 @@ class PlanarControls extends THREE.EventDispatcher {
// new zoom
if (this.camera.isOrthographicCamera && this.camera.zoom !== zoom) {
this.camera.zoom = zoom;
this.view.camera.matrixProjectionNeedsUpdate = true;
this.camera.updateProjectionMatrix();
}

// new rotation
Expand Down
5 changes: 0 additions & 5 deletions src/Renderer/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class Camera {
this.width = width;
this.height = height;
this._viewMatrixNeedsUpdate = true;
this.matrixProjectionNeedsUpdate = false;
this.resize(width, height);

this._preSSE = Infinity;
Expand Down Expand Up @@ -171,10 +170,6 @@ class Camera {
update() {
// update matrix
this.camera3D.updateMatrixWorld();
if (this.matrixProjectionNeedsUpdate) {
this.camera3D.updateProjectionMatrix();
this.matrixProjectionNeedsUpdate = false;
}
this._viewMatrixNeedsUpdate = true;
}

Expand Down

0 comments on commit a501c92

Please sign in to comment.