From 1569ed9c23f3fb266250ee76167edfbf7e2d80fe Mon Sep 17 00:00:00 2001 From: CODEX Date: Thu, 4 Jun 2026 23:10:26 +0300 Subject: [PATCH] beam: tune camera zoom precision --- frontend/dcViewer.js | 25 +++++++++++++++++++++++++ frontend/index.html | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/dcViewer.js b/frontend/dcViewer.js index a905569..85f6bb0 100644 --- a/frontend/dcViewer.js +++ b/frontend/dcViewer.js @@ -242,8 +242,32 @@ let suppressEdgeReload = false; let lastAttemptedProjectId = null; const treeModelIds = new Set(); +const CAMERA_CONTROL_SETTINGS = { + keyboardDollyRate: 45, + mouseWheelDollyRate: 20, + dollyInertia: 0, + dollyMinSpeed: 0.008, + dollyProximityThreshold: 90, +}; + +const configureCameraControl = () => { + const control = viewer?.cameraControl; + if (!control) return; + control.panRightClick = false; + control.followPointer = true; + control.doublePickFlyTo = false; + control.smartPivot = true; + control.zoomOnMouseWheel = true; + control.keyboardDollyRate = CAMERA_CONTROL_SETTINGS.keyboardDollyRate; + control.mouseWheelDollyRate = CAMERA_CONTROL_SETTINGS.mouseWheelDollyRate; + control.dollyInertia = CAMERA_CONTROL_SETTINGS.dollyInertia; + control.dollyMinSpeed = CAMERA_CONTROL_SETTINGS.dollyMinSpeed; + control.dollyProximityThreshold = CAMERA_CONTROL_SETTINGS.dollyProximityThreshold; +}; + const ensureCameraControlActive = () => { if (!viewer || !viewer.cameraControl) return; + configureCameraControl(); if (viewer.cameraControl.enabled === false) { viewer.cameraControl.enabled = true; } @@ -2465,6 +2489,7 @@ const initViewer = async () => { dtxEnabled: true, colorTextureEnabled: true, }); + configureCameraControl(); defaultCameraWorldAxis = snapshotVec(viewer.camera?.worldAxis) || [...NAVIGATION_AXIS_PRESETS["y-up"].worldAxis]; defaultCameraUp = snapshotVec(viewer.camera?.up) || [...NAVIGATION_AXIS_PRESETS["y-up"].up]; if (viewer.scene?.highlightMaterial) { diff --git a/frontend/index.html b/frontend/index.html index 8bf1a14..1f7f7a3 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -238,6 +238,6 @@ - +