vim-web 0.3.42-dev.9 → 0.3.43

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.
@@ -11,6 +11,7 @@ import { InstancedMesh } from '../../loader/progressive/instancedMesh';
11
11
  export declare class RenderScene {
12
12
  scene: THREE.Scene;
13
13
  boxUpdated: boolean;
14
+ smallGhostThreshold: number | undefined;
14
15
  private _vimScenes;
15
16
  private _boundingBox;
16
17
  private _memory;
@@ -76,6 +76,8 @@ export declare class Renderer implements IRenderer {
76
76
  */
77
77
  get textEnabled(): boolean;
78
78
  set textEnabled(value: boolean);
79
+ get smallGhostThreshold(): number;
80
+ set smallGhostThreshold(value: number);
79
81
  /**
80
82
  * Returns the bounding box encompassing all rendered objects.
81
83
  * @param target - Box in which to copy the result. A new instance is created if undefined.
@@ -35,6 +35,7 @@ export type ComponentSettings = {
35
35
  materials: {
36
36
  useFastMaterial: boolean;
37
37
  useGhostMaterial: boolean;
38
+ smallGhostThreshold: number;
38
39
  };
39
40
  isolation: {
40
41
  enable: boolean;
@@ -45717,9 +45717,15 @@ void main() {
45717
45717
  return this._visibleAttribute.value;
45718
45718
  }
45719
45719
  set visible(value) {
45720
+ var _a2;
45720
45721
  if (this._visibleAttribute.apply(value)) {
45721
45722
  this.vim.scene.setDirty();
45722
45723
  }
45724
+ if (value) {
45725
+ (_a2 = this._meshes) == null ? void 0 : _a2.forEach((m) => {
45726
+ m.mesh.mesh.visible = true;
45727
+ });
45728
+ }
45723
45729
  }
45724
45730
  /**
45725
45731
  * Gets or sets the display color of this object.
@@ -52780,6 +52786,8 @@ void main() {
52780
52786
  __publicField(this, "scene");
52781
52787
  // state
52782
52788
  __publicField(this, "boxUpdated", false);
52789
+ // public value
52790
+ __publicField(this, "smallGhostThreshold", 10);
52783
52791
  __publicField(this, "_vimScenes", []);
52784
52792
  __publicField(this, "_boundingBox");
52785
52793
  __publicField(this, "_memory", 0);
@@ -52834,6 +52842,7 @@ void main() {
52834
52842
  add(target) {
52835
52843
  if (target instanceof Scene) {
52836
52844
  this.addScene(target);
52845
+ target.material = this._modelMaterial;
52837
52846
  return;
52838
52847
  }
52839
52848
  this._2dCount += this.count2dObjects(target);
@@ -52898,10 +52907,14 @@ void main() {
52898
52907
  const hide = ((_b2 = (_a2 = this._modelMaterial) == null ? void 0 : _a2[1]) == null ? void 0 : _b2.userData.isGhost) === true;
52899
52908
  for (const mesh of this.meshes) {
52900
52909
  if (mesh instanceof InstancedMesh) {
52910
+ if (this.smallGhostThreshold <= 0) {
52911
+ mesh.mesh.visible = true;
52912
+ continue;
52913
+ }
52901
52914
  const visible2 = mesh.getSubmeshes().some(
52902
52915
  (m) => m.object.visible
52903
52916
  );
52904
- mesh.mesh.visible = !(hide && !visible2 && mesh.size < 10);
52917
+ mesh.mesh.visible = !(hide && !visible2 && mesh.size < this.smallGhostThreshold);
52905
52918
  }
52906
52919
  }
52907
52920
  }
@@ -56578,6 +56591,12 @@ void main() {
56578
56591
  this._renderText = value;
56579
56592
  this.textRenderer.domElement.style.display = value ? "block" : "none";
56580
56593
  }
56594
+ get smallGhostThreshold() {
56595
+ return this._scene.smallGhostThreshold;
56596
+ }
56597
+ set smallGhostThreshold(value) {
56598
+ this._scene.smallGhostThreshold = value;
56599
+ }
56581
56600
  /**
56582
56601
  * Returns the bounding box encompassing all rendered objects.
56583
56602
  * @param target - Box in which to copy the result. A new instance is created if undefined.
@@ -66866,7 +66885,8 @@ Averrage Date/Second ${avgDataRatePS} kb
66866
66885
  const defaultSettings = {
66867
66886
  materials: {
66868
66887
  useFastMaterial: false,
66869
- useGhostMaterial: true
66888
+ useGhostMaterial: true,
66889
+ smallGhostThreshold: 10
66870
66890
  },
66871
66891
  isolation: {
66872
66892
  enable: true
@@ -74328,6 +74348,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74328
74348
  performance2.classList.add("vc-hidden");
74329
74349
  }
74330
74350
  }
74351
+ viewer.renderer.smallGhostThreshold = settings2.materials.smallGhostThreshold;
74331
74352
  }
74332
74353
  class Isolation {
74333
74354
  /**
@@ -75698,7 +75719,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75698
75719
  }
75699
75720
  if (state.status === "connecting") {
75700
75721
  if (modal.current === void 0 || modal.current.type === "loading") {
75701
- modal.loading({ message: "Connecting to VIM Ultra server..." });
75722
+ modal.loading({ message: "Initializing..." });
75702
75723
  }
75703
75724
  }
75704
75725
  if (state.status === "error") {