@d5techs/3dgs-lib 1.4.9 → 1.4.11

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