@jdultra/threedtiles 13.0.19 → 13.0.21

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.
@@ -2549,7 +2549,7 @@ class Ni {
2549
2549
  let t, A = 0, i = Number.MAX_SAFE_INTEGER, s = -1;
2550
2550
  for (let r = this.downloads.length - 1; r >= 0; r--) {
2551
2551
  const o = this.downloads[r].distanceFunction();
2552
- o <= e && (e = o, a = r), A = Math.max(this.downloads[r].level), this.downloads[r].loadingStrategy != "IMMEDIATE" && i > this.downloads[r].level && (i = this.downloads[r].level, s = r);
2552
+ o <= e && (e = o, a = r), A = Math.max(this.downloads[r].level), this.downloads[r].loadingStrategy != "IMMEDIATE" && this.downloads[r].level < i && (i = this.downloads[r].level, s = r);
2553
2553
  }
2554
2554
  if (A > i + 4 ? t = this.downloads.splice(s, 1).pop() : a >= 0 && (t = this.downloads.splice(a, 1).pop()), t) {
2555
2555
  this.nextDownloads.push(t);
@@ -3515,10 +3515,7 @@ class Wt extends E.Object3D {
3515
3515
  h.geometry.setAttribute("color", new E.Float32BufferAttribute(f, 3));
3516
3516
  }
3517
3517
  }), t.add(g), t.updateMatrices()));
3518
- }, t.cameraOnLoad ? () => {
3519
- let g = 1;
3520
- return (t.metric && t.metric < 0 || t.deleted) && (g = 2), t.parentTile ? t.parentTile._calculateDistanceToCamera(t.cameraOnLoad) * g * t.level : t._calculateDistanceToCamera(t.cameraOnLoad) * g * t.level;
3521
- } : () => 0, () => t._getSiblings(), t.level, t.loadingStrategy, !t.json.boundingVolume.region, !!t.json.boundingVolume.region, t.geometricError, t.splatsMesh);
3518
+ }, t.cameraOnLoad ? () => t.loadingStrategy == "IMMEDIATE" ? t._calculateDistanceToCamera(t.cameraOnLoad) : t.loadingStrategy == "INTERMEDIATE" ? t.parentTile ? t.parentTile._calculateDistanceToCamera(t.cameraOnLoad) / t.level : t._calculateDistanceToCamera(t.cameraOnLoad) / t.level : t.loadingStrategy == "PERLEVEL" ? t.parentTile ? t.level + t.parentTile._calculateDistanceToCamera(t.cameraOnLoad) : t.level + t._calculateDistanceToCamera(t.cameraOnLoad) : void 0 : () => 0, () => t._getSiblings(), t.level, t.loadingStrategy, !t.json.boundingVolume.region, !!t.json.boundingVolume.region, t.geometricError, t.splatsMesh);
3522
3519
  } catch (g) {
3523
3520
  t.displayErrors && gt(g);
3524
3521
  }