@d5techs/3dgs-lib 1.4.9 → 1.4.10
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/3dgs-lib.cjs
CHANGED
|
@@ -1014,6 +1014,7 @@ class ViewportGizmo {
|
|
|
1014
1014
|
__publicField(this, "size", 140);
|
|
1015
1015
|
__publicField(this, "margin", 10);
|
|
1016
1016
|
__publicField(this, "scale", 40);
|
|
1017
|
+
__publicField(this, "_visible", false);
|
|
1017
1018
|
__publicField(this, "onAxisClick");
|
|
1018
1019
|
__publicField(this, "resizeObserver");
|
|
1019
1020
|
this.camera = camera;
|
|
@@ -1032,7 +1033,8 @@ class ViewportGizmo {
|
|
|
1032
1033
|
width: `${this.size}px`,
|
|
1033
1034
|
height: `${this.size}px`,
|
|
1034
1035
|
pointerEvents: "none",
|
|
1035
|
-
zIndex: "10"
|
|
1036
|
+
zIndex: "10",
|
|
1037
|
+
display: this._visible ? "" : "none"
|
|
1036
1038
|
});
|
|
1037
1039
|
this.positionContainer();
|
|
1038
1040
|
this.svg = document.createElementNS(ns, "svg");
|
|
@@ -1138,10 +1140,20 @@ class ViewportGizmo {
|
|
|
1138
1140
|
});
|
|
1139
1141
|
this.resizeObserver.observe(this.canvas);
|
|
1140
1142
|
}
|
|
1143
|
+
get visible() {
|
|
1144
|
+
return this._visible;
|
|
1145
|
+
}
|
|
1146
|
+
set visible(v) {
|
|
1147
|
+
this._visible = v;
|
|
1148
|
+
if (this.container) {
|
|
1149
|
+
this.container.style.display = v ? "" : "none";
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1141
1152
|
/**
|
|
1142
1153
|
* 每帧更新 SVG 位置(从相机视图矩阵中提取轴投影)
|
|
1143
1154
|
*/
|
|
1144
1155
|
render(_pass) {
|
|
1156
|
+
if (!this._visible) return;
|
|
1145
1157
|
const vm = this.camera.viewMatrix;
|
|
1146
1158
|
const vecx = { x: vm[0], y: vm[1], z: vm[2] };
|
|
1147
1159
|
const vecy = { x: vm[4], y: vm[5], z: vm[6] };
|
|
@@ -13231,6 +13243,9 @@ class GizmoManager {
|
|
|
13231
13243
|
getViewportGizmo() {
|
|
13232
13244
|
return this.viewportGizmo;
|
|
13233
13245
|
}
|
|
13246
|
+
setViewportGizmoVisible(visible) {
|
|
13247
|
+
this.viewportGizmo.visible = visible;
|
|
13248
|
+
}
|
|
13234
13249
|
// ============================================
|
|
13235
13250
|
// Bounding Box
|
|
13236
13251
|
// ============================================
|
|
@@ -16532,6 +16547,9 @@ class App {
|
|
|
16532
16547
|
getViewportGizmo() {
|
|
16533
16548
|
return this.gizmoManager.getViewportGizmo();
|
|
16534
16549
|
}
|
|
16550
|
+
setViewportGizmoVisible(visible) {
|
|
16551
|
+
this.gizmoManager.setViewportGizmoVisible(visible);
|
|
16552
|
+
}
|
|
16535
16553
|
getBoundingBoxRenderer() {
|
|
16536
16554
|
return this.gizmoManager.getBoundingBoxRenderer();
|
|
16537
16555
|
}
|