beam: restore camera panning controls

This commit is contained in:
CODEX 2026-06-04 23:43:57 +03:00
parent 43accba61c
commit bb30202b9b
2 changed files with 23 additions and 2 deletions

View File

@ -259,11 +259,29 @@ const normalizeZoomSpeed = (value) => {
return Math.min(100, Math.max(5, Math.round(numeric))); return Math.min(100, Math.max(5, Math.round(numeric)));
}; };
const configureCameraPanMap = (control) => {
const input = viewer?.scene?.input;
if (!control || !input) return;
if (control.MOUSE_PAN === undefined || control.MOUSE_ROTATE === undefined || control.MOUSE_DOLLY === undefined) return;
control.panRightClick = true;
control.keyMap = {
...(control.keyMap || {}),
[control.MOUSE_PAN]: [
[input.MOUSE_LEFT_BUTTON, input.KEY_SHIFT],
input.MOUSE_MIDDLE_BUTTON,
input.MOUSE_RIGHT_BUTTON,
],
[control.MOUSE_ROTATE]: [input.MOUSE_LEFT_BUTTON],
[control.MOUSE_DOLLY]: [],
};
};
const configureCameraControl = () => { const configureCameraControl = () => {
const control = viewer?.cameraControl; const control = viewer?.cameraControl;
if (!control) return; if (!control) return;
activeZoomSpeed = normalizeZoomSpeed(activeZoomSpeed); activeZoomSpeed = normalizeZoomSpeed(activeZoomSpeed);
control.panRightClick = false; configureCameraPanMap(control);
control.followPointer = true; control.followPointer = true;
control.doublePickFlyTo = false; control.doublePickFlyTo = false;
control.smartPivot = true; control.smartPivot = true;
@ -2651,6 +2669,9 @@ const initViewer = async () => {
const canvasEl = viewer.scene?.canvas?.canvas; const canvasEl = viewer.scene?.canvas?.canvas;
if (canvasEl) { if (canvasEl) {
let downPos = null; let downPos = null;
canvasEl.addEventListener("contextmenu", (event) => {
event.preventDefault();
});
canvasEl.addEventListener("pointerdown", (event) => { canvasEl.addEventListener("pointerdown", (event) => {
if (measureActive) { if (measureActive) {
downPos = null; downPos = null;

View File

@ -239,6 +239,6 @@
<input id="fileInput" class="hidden" type="file" <input id="fileInput" class="hidden" type="file"
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl"> accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
<script type="module" src="./dcViewer.js?v=8"></script> <script type="module" src="./dcViewer.js?v=9"></script>
</body> </body>
</html> </html>