(mode)
| 124 | } |
| 125 | |
| 126 | setCameraMode(mode) { |
| 127 | const nextMode = mode === "orthographic" ? "orthographic" : "perspective"; |
| 128 | if (nextMode === this.cameraMode) { |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | this.saveCurrentCameraState(); |
| 133 | |
| 134 | this.cameraMode = nextMode; |
| 135 | this.activeCamera = nextMode === "orthographic" ? this.orthographicCamera : this.perspectiveCamera; |
| 136 | this.controls.object = this.activeCamera; |
| 137 | this.restoreCameraState(nextMode); |
| 138 | this.handleResize(); |
| 139 | |
| 140 | if (this.cameraView !== "free") { |
| 141 | this.applyView(this.cameraView); |
| 142 | } else { |
| 143 | this.controls.enableRotate = true; |
| 144 | this.controls.update(); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | setCameraView(view) { |
| 149 | const allowedViews = new Set(["free", "top", "east", "north"]); |
no test coverage detected