beam: restore camera panning controls
This commit is contained in:
parent
43accba61c
commit
bb30202b9b
|
|
@ -259,11 +259,29 @@ const normalizeZoomSpeed = (value) => {
|
|||
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 control = viewer?.cameraControl;
|
||||
if (!control) return;
|
||||
activeZoomSpeed = normalizeZoomSpeed(activeZoomSpeed);
|
||||
control.panRightClick = false;
|
||||
configureCameraPanMap(control);
|
||||
control.followPointer = true;
|
||||
control.doublePickFlyTo = false;
|
||||
control.smartPivot = true;
|
||||
|
|
@ -2651,6 +2669,9 @@ const initViewer = async () => {
|
|||
const canvasEl = viewer.scene?.canvas?.canvas;
|
||||
if (canvasEl) {
|
||||
let downPos = null;
|
||||
canvasEl.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault();
|
||||
});
|
||||
canvasEl.addEventListener("pointerdown", (event) => {
|
||||
if (measureActive) {
|
||||
downPos = null;
|
||||
|
|
|
|||
|
|
@ -239,6 +239,6 @@
|
|||
<input id="fileInput" class="hidden" type="file"
|
||||
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>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue