@inweb/viewer-three 25.10.1 → 25.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/viewer-three.js +14517 -1292
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +2 -2
- package/dist/viewer-three.module.js +2980 -260
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +41 -3
- package/lib/Viewer/commands/index.d.ts +1 -1
- package/lib/Viewer/components/SelectionComponent.d.ts +2 -2
- package/lib/Viewer/draggers/OrbitDragger.d.ts +1 -1
- package/package.json +5 -4
- package/src/Viewer/Viewer.ts +212 -21
- package/src/Viewer/commands/ClearMarkup.ts +1 -2
- package/src/Viewer/commands/{Unselect.ts → ClearSelected.ts} +4 -3
- package/src/Viewer/commands/ClearSlices.ts +1 -6
- package/src/Viewer/commands/Explode.ts +1 -1
- package/src/Viewer/commands/HideSelected.ts +2 -2
- package/src/Viewer/commands/IsolateSelected.ts +1 -1
- package/src/Viewer/commands/ResetView.ts +2 -2
- package/src/Viewer/commands/SetDefaultViewPosition.ts +8 -7
- package/src/Viewer/commands/SetSelected.ts +1 -1
- package/src/Viewer/commands/ShowAll.ts +1 -1
- package/src/Viewer/commands/index.ts +1 -1
- package/src/Viewer/components/DefaultPositionComponent.ts +1 -1
- package/src/Viewer/components/SelectionComponent.ts +9 -10
- package/src/Viewer/controls/OrbitControls.js +1007 -0
- package/src/Viewer/controls/WalkControls.ts +1 -0
- package/src/Viewer/draggers/OrbitDragger.ts +28 -4
- /package/lib/Viewer/commands/{Unselect.d.ts → ClearSelected.d.ts} +0 -0
|
@@ -192,6 +192,7 @@ export class WalkControls extends EventDispatcher {
|
|
|
192
192
|
|
|
193
193
|
if (this.moveWheel !== 0) {
|
|
194
194
|
const moveDelta = this.moveWheel * 0.0001 * this.movementSpeed * this.multiplier;
|
|
195
|
+
|
|
195
196
|
this.camera.translateZ(-moveDelta);
|
|
196
197
|
this.moveWheel += -1 * Math.sign(this.moveWheel);
|
|
197
198
|
this.dispatchEvent(_changeEvent);
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
import { MOUSE, TOUCH } from "three";
|
|
25
|
-
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
26
25
|
|
|
27
26
|
import type { IDisposable } from "../IDisposable";
|
|
28
27
|
import type { Viewer } from "../Viewer";
|
|
28
|
+
import { OrbitControls, STATE } from "../controls/OrbitControls.js";
|
|
29
29
|
|
|
30
30
|
export class OrbitDragger implements IDisposable {
|
|
31
31
|
protected viewer: Viewer;
|
|
@@ -45,15 +45,17 @@ export class OrbitDragger implements IDisposable {
|
|
|
45
45
|
this.viewer.on("geometryend", this.updateControls);
|
|
46
46
|
this.viewer.on("viewposition", this.updateControls);
|
|
47
47
|
this.viewer.on("zoom", this.updateControls);
|
|
48
|
+
this.viewer.on("drawviewpoint", this.updateControls);
|
|
48
49
|
this.viewer.on("contextmenu", this.stopContextMenu);
|
|
49
50
|
this.updateControls();
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
dispose(): void {
|
|
53
|
-
this.viewer.off("contextmenu", this.stopContextMenu);
|
|
54
|
-
this.viewer.off("zoom", this.updateControls);
|
|
55
|
-
this.viewer.off("viewposition", this.updateControls);
|
|
56
54
|
this.viewer.off("geometryend", this.updateControls);
|
|
55
|
+
this.viewer.off("viewposition", this.updateControls);
|
|
56
|
+
this.viewer.off("zoom", this.updateControls);
|
|
57
|
+
this.viewer.off("drawviewpoint", this.updateControls);
|
|
58
|
+
this.viewer.off("contextmenu", this.stopContextMenu);
|
|
57
59
|
|
|
58
60
|
this.orbit.removeEventListener("change", this.controlsChange);
|
|
59
61
|
this.orbit.dispose();
|
|
@@ -74,6 +76,28 @@ export class OrbitDragger implements IDisposable {
|
|
|
74
76
|
this.viewer.target.copy(this.orbit.target);
|
|
75
77
|
this.viewer.update();
|
|
76
78
|
|
|
79
|
+
switch (this.orbit.state) {
|
|
80
|
+
case STATE.PAN:
|
|
81
|
+
case STATE.TOUCH_PAN:
|
|
82
|
+
this.viewer.emitEvent({
|
|
83
|
+
type: "pan",
|
|
84
|
+
x: this.orbit.panEnd.x,
|
|
85
|
+
y: this.orbit.panEnd.y,
|
|
86
|
+
dX: this.orbit.panDelta.x,
|
|
87
|
+
dY: this.orbit.panDelta.y,
|
|
88
|
+
});
|
|
89
|
+
break;
|
|
90
|
+
|
|
91
|
+
case STATE.DOLLY:
|
|
92
|
+
this.viewer.emitEvent({
|
|
93
|
+
type: "zoomat",
|
|
94
|
+
data: this.orbit.dollyScale,
|
|
95
|
+
x: this.orbit.dollyEnd.x,
|
|
96
|
+
y: this.orbit.dollyEnd.y,
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
|
|
77
101
|
this.changed = true;
|
|
78
102
|
};
|
|
79
103
|
|
|
File without changes
|