@rings-webgpu/core 1.0.33 → 1.0.34

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.
@@ -42153,7 +42153,7 @@ else if (typeof exports === 'object')
42153
42153
  }
42154
42154
  }
42155
42155
 
42156
- const version = "1.0.32";
42156
+ const version = "1.0.33";
42157
42157
 
42158
42158
  class Engine3D {
42159
42159
  /**
@@ -65414,8 +65414,10 @@ fn frag(){
65414
65414
  tileItem.loadingState = UNLOADED;
65415
65415
  });
65416
65416
  }
65417
- if (tile.active) {
65417
+ {
65418
65418
  this.setTileActive(tile, true);
65419
+ tile.active = true;
65420
+ this.stats.active++;
65419
65421
  }
65420
65422
  } else {
65421
65423
  tile.loadingState = FAILED;
@@ -65462,55 +65464,18 @@ fn frag(){
65462
65464
  }
65463
65465
  }
65464
65466
  }
65465
- _checkIsLoadingTileWillBeActive(tile) {
65466
- return tile.used && (tile.loadingState === LOADING || tile.loadingState === PARSING || !this._activeTiles.has(tile) || !this._visibleTiles.has(tile)) && tile.loadingState !== UNLOADED && tile.loadingState !== FAILED && tile.hasRenderableContent;
65467
- }
65468
- /**
65469
- * Get children tiles that are loading and will be active
65470
- * Check if child is used in current frame (will be displayed) but not yet loaded
65471
- */
65472
- _getLoadingChildrenThatWillBeActive(tile) {
65473
- const loadingChildren = [];
65474
- const children = tile.children;
65475
- for (let i = 0, l = children.length; i < l; i++) {
65476
- const child = children[i];
65477
- if (this._checkIsLoadingTileWillBeActive(child)) {
65478
- loadingChildren.push(child);
65479
- }
65480
- if (child.children && child.children.length > 0) {
65481
- loadingChildren.push(...this._getLoadingChildrenThatWillBeActive(child));
65482
- }
65483
- }
65484
- return loadingChildren;
65485
- }
65486
- /**
65487
- * Get parents tiles that are loading and will be active
65488
- * Check if parent is used in current frame (will be displayed) but not yet loaded
65489
- */
65490
- _getLoadingParentsThatWillBeActive(tile) {
65491
- const loadingParents = [];
65492
- const parent = tile.parent;
65493
- if (parent) {
65494
- if (this._checkIsLoadingTileWillBeActive(parent)) {
65495
- loadingParents.push(parent);
65496
- }
65497
- }
65498
- return loadingParents;
65499
- }
65500
65467
  /**
65501
65468
  * Check and process delayed hide tiles when a child finishes loading
65502
65469
  */
65503
65470
  _checkDelayedHideTiles() {
65471
+ if (this.stats.downloading !== 0) {
65472
+ return;
65473
+ }
65504
65474
  for (const tile of this._delayedHideTiles) {
65505
- const stillLoadingChildren = this._getLoadingChildrenThatWillBeActive(tile);
65506
- const stillLoadingParents = this._getLoadingParentsThatWillBeActive(tile);
65507
- const stillLoading = [...stillLoadingChildren, ...stillLoadingParents];
65508
- if (stillLoading.length === 0) {
65509
- this._delayedHideTiles.delete(tile);
65510
- const scene = tile.cached.scene;
65511
- if (scene) {
65512
- scene.transform.enable = false;
65513
- }
65475
+ this._delayedHideTiles.delete(tile);
65476
+ const scene = tile.cached.scene;
65477
+ if (scene) {
65478
+ scene.transform.enable = false;
65514
65479
  }
65515
65480
  }
65516
65481
  }
@@ -207,17 +207,6 @@ export declare class TilesRenderer {
207
207
  * Set tile active state
208
208
  */
209
209
  setTileActive(tile: Tile, active: boolean): void;
210
- private _checkIsLoadingTileWillBeActive;
211
- /**
212
- * Get children tiles that are loading and will be active
213
- * Check if child is used in current frame (will be displayed) but not yet loaded
214
- */
215
- private _getLoadingChildrenThatWillBeActive;
216
- /**
217
- * Get parents tiles that are loading and will be active
218
- * Check if parent is used in current frame (will be displayed) but not yet loaded
219
- */
220
- private _getLoadingParentsThatWillBeActive;
221
210
  /**
222
211
  * Check and process delayed hide tiles when a child finishes loading
223
212
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rings-webgpu/core",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Rings webgpu Engine",
5
5
  "main": "index.js",
6
6
  "exports": {