beam: tune camera zoom precision
This commit is contained in:
parent
f40a6ce38d
commit
1569ed9c23
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -238,6 +238,6 @@
|
|||
<input id="fileInput" class="hidden" type="file"
|
||||
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
|
||||
|
||||
<script type="module" src="./dcViewer.js?v=5"></script>
|
||||
<script type="module" src="./dcViewer.js?v=6"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue