@inweb/viewer-three 26.12.4 → 26.12.6
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 +11 -10
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +1 -1
- package/dist/viewer-three.module.js +11 -10
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/components/ResetComponent.d.ts +1 -1
- package/package.json +5 -5
- package/src/Viewer/commands/ResetView.ts +0 -5
- package/src/Viewer/components/ResetComponent.ts +5 -2
- package/src/Viewer/controls/JoyStickControls.ts +1 -1
package/dist/viewer-three.js
CHANGED
|
@@ -34790,7 +34790,7 @@ void main() {
|
|
|
34790
34790
|
this.overlayElement.style.position = "fixed";
|
|
34791
34791
|
this.overlayElement.style.zIndex = "0";
|
|
34792
34792
|
this.overlayElement.style.touchAction = "none";
|
|
34793
|
-
|
|
34793
|
+
canvasElement.parentElement.appendChild(this.overlayElement);
|
|
34794
34794
|
this.joyStickCanvas = document.createElement("canvas");
|
|
34795
34795
|
this.joyStickCanvas.id = "joyStickCanvas";
|
|
34796
34796
|
this.joyStickCanvas.width = this.CANVAS_SIZE;
|
|
@@ -35313,7 +35313,6 @@ void main() {
|
|
|
35313
35313
|
}
|
|
35314
35314
|
|
|
35315
35315
|
function resetView(viewer) {
|
|
35316
|
-
const reset = viewer.getComponent("ResetComponent");
|
|
35317
35316
|
viewer.executeCommand("setActiveDragger");
|
|
35318
35317
|
viewer.executeCommand("clearSlices");
|
|
35319
35318
|
viewer.executeCommand("clearOverlay");
|
|
@@ -35322,7 +35321,6 @@ void main() {
|
|
|
35322
35321
|
viewer.executeCommand("showAll");
|
|
35323
35322
|
viewer.executeCommand("explode", 0);
|
|
35324
35323
|
viewer.executeCommand("zoomToExtents", true);
|
|
35325
|
-
reset.resetCameraPosition();
|
|
35326
35324
|
viewer.emit({ type: "resetview" });
|
|
35327
35325
|
}
|
|
35328
35326
|
|
|
@@ -36896,19 +36894,22 @@ void main() {
|
|
|
36896
36894
|
direction: this.viewer.camera.getWorldDirection(new Vector3()),
|
|
36897
36895
|
};
|
|
36898
36896
|
};
|
|
36897
|
+
this.resetCameraPosition = () => {
|
|
36898
|
+
if (this.savedCameraPosition) {
|
|
36899
|
+
this.viewer.camera.position.copy(this.savedCameraPosition.position);
|
|
36900
|
+
this.viewer.camera.up.copy(this.savedCameraPosition.up);
|
|
36901
|
+
this.viewer.camera.lookAt(this.savedCameraPosition.position.clone().add(this.savedCameraPosition.direction));
|
|
36902
|
+
this.viewer.camera.updateProjectionMatrix();
|
|
36903
|
+
}
|
|
36904
|
+
};
|
|
36899
36905
|
this.viewer = viewer;
|
|
36900
36906
|
this.viewer.addEventListener("databasechunk", this.onDatabaseChunk);
|
|
36907
|
+
this.viewer.on("resetview", this.resetCameraPosition);
|
|
36901
36908
|
}
|
|
36902
36909
|
dispose() {
|
|
36910
|
+
this.viewer.off("resetview", this.resetCameraPosition);
|
|
36903
36911
|
this.viewer.removeEventListener("databasechunk", this.onDatabaseChunk);
|
|
36904
36912
|
}
|
|
36905
|
-
resetCameraPosition() {
|
|
36906
|
-
if (this.savedCameraPosition) {
|
|
36907
|
-
this.viewer.camera.position.copy(this.savedCameraPosition.position);
|
|
36908
|
-
this.viewer.camera.up.copy(this.savedCameraPosition.up);
|
|
36909
|
-
this.viewer.camera.lookAt(this.savedCameraPosition.position.clone().add(this.savedCameraPosition.direction));
|
|
36910
|
-
}
|
|
36911
|
-
}
|
|
36912
36913
|
}
|
|
36913
36914
|
|
|
36914
36915
|
const components = componentsRegistry("threejs");
|