MCPcopy Create free account
hub / github.com/DFin/palaeograph / setCameraMode

Method setCameraMode

src/sceneManager.js:126–146  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

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"]);

Callers 3

applyCameraModeFunction · 0.80
applyCameraViewFunction · 0.80
main.jsFile · 0.80

Calls 4

restoreCameraStateMethod · 0.95
handleResizeMethod · 0.95
applyViewMethod · 0.95

Tested by

no test coverage detected