Fix zoom not working on with out changing camera mode

This commit is contained in:
Mike Molinari 2022-11-06 08:36:25 +00:00
parent 94fa1c3ba9
commit 2c7fca94d3

View file

@ -19,6 +19,7 @@ export default class Viewer {
this.cameraMode$ = externalState(() => this.getCameraMode(), mode => this.setCameraMode(mode)) this.cameraMode$ = externalState(() => this.getCameraMode(), mode => this.setCameraMode(mode))
this.sceneSetup = new SceneSetUp(container); this.sceneSetup = new SceneSetUp(container);
this.setCameraMode(this.sceneSetup.oCamera);
} }
render() { render() {
@ -49,9 +50,9 @@ export default class Viewer {
} }
setCameraMode(mode) { setCameraMode(mode) {
if (this.getCameraMode() === mode) { // if (this.getCameraMode() === mode) {
return; // return;
} // }
if (mode === CAMERA_MODE.PERSPECTIVE) { if (mode === CAMERA_MODE.PERSPECTIVE) {
this.sceneSetup.setCamera(this.sceneSetup.pCamera); this.sceneSetup.setCamera(this.sceneSetup.pCamera);
} else { } else {
@ -64,6 +65,7 @@ export default class Viewer {
} }
toggleCamera() { toggleCamera() {
alert("camera toggled")
if (this.getCameraMode() === CAMERA_MODE.PERSPECTIVE) { if (this.getCameraMode() === CAMERA_MODE.PERSPECTIVE) {
this.setCameraMode(CAMERA_MODE.ORTHOGRAPHIC); this.setCameraMode(CAMERA_MODE.ORTHOGRAPHIC);
} else { } else {