@idetik/core 0.7.6 → 0.7.7
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/index.d.ts +2 -1
- package/dist/index.js +32 -29
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/chunk_store_view.d.ts +2 -1
- package/dist/types/src/core/chunk_store_view.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -546,7 +546,7 @@ declare class ChunkStoreView {
|
|
|
546
546
|
getChunksToRender(sliceCoords: SliceCoordinates): Chunk[];
|
|
547
547
|
updateChunkStatesForVolume(sliceCoords: SliceCoordinates): void;
|
|
548
548
|
updateChunkStates(sliceCoords: SliceCoordinates, viewport: Viewport): void;
|
|
549
|
-
|
|
549
|
+
allVisibleFallbackLODLoaded(sliceCoords: SliceCoordinates): boolean;
|
|
550
550
|
get currentLOD(): number;
|
|
551
551
|
maybeForgetChunk(chunk: Chunk): void;
|
|
552
552
|
dispose(): void;
|
|
@@ -558,6 +558,7 @@ declare class ChunkStoreView {
|
|
|
558
558
|
private markTimeChunksForPrefetch;
|
|
559
559
|
private computePriority;
|
|
560
560
|
private isChunkWithinBounds;
|
|
561
|
+
private fallbackLOD;
|
|
561
562
|
private getZBounds;
|
|
562
563
|
private viewBounds2DChanged;
|
|
563
564
|
private zBoundsChanged;
|
package/dist/index.js
CHANGED
|
@@ -2154,7 +2154,7 @@ class _C {
|
|
|
2154
2154
|
getChunksToRender(A) {
|
|
2155
2155
|
const I = this.store_.getTimeIndex(A), B = this.store_.getChunksAtTime(I), C = B.filter(
|
|
2156
2156
|
(i) => i.lod === this.currentLOD_ && this.chunkViewStates_.get(i)?.visible === !0 && i.state === "loaded"
|
|
2157
|
-
), Q = this.
|
|
2157
|
+
), Q = this.fallbackLOD();
|
|
2158
2158
|
if (this.currentLOD_ === Q)
|
|
2159
2159
|
return C;
|
|
2160
2160
|
const E = B.filter(
|
|
@@ -2200,9 +2200,9 @@ class _C {
|
|
|
2200
2200
|
const h = this.getZBounds(A);
|
|
2201
2201
|
(this.policyChanged_ || this.viewBounds2DChanged(Q) || this.zBoundsChanged(h) || this.lastTCoord_ !== A.t) && (this.updateChunkViewStates(A, Q), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t);
|
|
2202
2202
|
}
|
|
2203
|
-
|
|
2204
|
-
const I = this.store_.getTimeIndex(A), B = this.store_.getChunksAtTime(I).filter((
|
|
2205
|
-
return
|
|
2203
|
+
allVisibleFallbackLODLoaded(A) {
|
|
2204
|
+
const I = this.store_.getTimeIndex(A), B = this.fallbackLOD(), C = this.store_.getChunksAtTime(I).filter((Q) => Q.visible && Q.lod === B);
|
|
2205
|
+
return C.length > 0 && C.every((Q) => Q.state === "loaded");
|
|
2206
2206
|
}
|
|
2207
2207
|
get currentLOD() {
|
|
2208
2208
|
return this.currentLOD_;
|
|
@@ -2264,22 +2264,22 @@ class _C {
|
|
|
2264
2264
|
return I.c === void 0 || I.c === A.chunkIndex.c;
|
|
2265
2265
|
}
|
|
2266
2266
|
updateChunksAtTimeIndex(A, I, B, C) {
|
|
2267
|
-
const Q = this.getPaddedBounds(B), E = this.store_.getChunksAtTime(A);
|
|
2268
|
-
for (const
|
|
2269
|
-
const
|
|
2270
|
-
h,
|
|
2271
|
-
D,
|
|
2272
|
-
o,
|
|
2267
|
+
const Q = this.getPaddedBounds(B), E = this.store_.getChunksAtTime(A), i = this.fallbackLOD();
|
|
2268
|
+
for (const o of E) {
|
|
2269
|
+
const a = this.isChunkWithinBounds(o, B), D = this.isChunkChannelInSlice(o, I), h = o.lod === this.currentLOD_, t = o.lod === i, y = !a && D && h && this.isChunkWithinBounds(o, Q), w = a && D, F = this.computePriority(
|
|
2273
2270
|
t,
|
|
2274
|
-
|
|
2271
|
+
h,
|
|
2272
|
+
a,
|
|
2273
|
+
y,
|
|
2274
|
+
D
|
|
2275
2275
|
);
|
|
2276
|
-
if (
|
|
2277
|
-
const
|
|
2278
|
-
this.chunkViewStates_.set(
|
|
2279
|
-
visible:
|
|
2280
|
-
prefetch:
|
|
2281
|
-
priority:
|
|
2282
|
-
orderKey:
|
|
2276
|
+
if (F !== null) {
|
|
2277
|
+
const S = this.squareDistance2D(o, C);
|
|
2278
|
+
this.chunkViewStates_.set(o, {
|
|
2279
|
+
visible: w,
|
|
2280
|
+
prefetch: y,
|
|
2281
|
+
priority: F,
|
|
2282
|
+
orderKey: S
|
|
2283
2283
|
});
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
@@ -2288,20 +2288,20 @@ class _C {
|
|
|
2288
2288
|
const Q = this.store_.dimensions.t?.lods[0].size ?? 1, E = Math.min(
|
|
2289
2289
|
Q - 1,
|
|
2290
2290
|
A + this.policy_.prefetch.t
|
|
2291
|
-
);
|
|
2292
|
-
for (let
|
|
2293
|
-
for (const
|
|
2294
|
-
if (
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2291
|
+
), i = this.fallbackLOD();
|
|
2292
|
+
for (let o = A + 1; o <= E; ++o)
|
|
2293
|
+
for (const a of this.store_.getChunksAtTime(o)) {
|
|
2294
|
+
if (a.lod !== i || !this.isChunkChannelInSlice(a, I) || !this.isChunkWithinBounds(a, B)) continue;
|
|
2295
|
+
const D = this.policy_.priorityMap.prefetchTime, h = this.squareDistance2D(a, C), t = vA(
|
|
2296
|
+
h / this.sourceMaxSquareDistance2D_,
|
|
2297
2297
|
0,
|
|
2298
2298
|
1 - Number.EPSILON
|
|
2299
|
-
),
|
|
2300
|
-
this.chunkViewStates_.set(
|
|
2299
|
+
), y = o - A + t;
|
|
2300
|
+
this.chunkViewStates_.set(a, {
|
|
2301
2301
|
visible: !1,
|
|
2302
2302
|
prefetch: !0,
|
|
2303
|
-
priority:
|
|
2304
|
-
orderKey:
|
|
2303
|
+
priority: D,
|
|
2304
|
+
orderKey: y
|
|
2305
2305
|
});
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
@@ -2321,6 +2321,9 @@ class _C {
|
|
|
2321
2321
|
);
|
|
2322
2322
|
return SA.intersects(B, I);
|
|
2323
2323
|
}
|
|
2324
|
+
fallbackLOD() {
|
|
2325
|
+
return Math.min(this.policy_.lod.max, this.store_.getLowestResLOD());
|
|
2326
|
+
}
|
|
2324
2327
|
getZBounds(A) {
|
|
2325
2328
|
const I = this.store_.dimensions.z;
|
|
2326
2329
|
if (I === void 0) return [0, 1];
|
|
@@ -4103,7 +4106,7 @@ class dB extends wA {
|
|
|
4103
4106
|
!A || !this.chunkStoreView_ || (this.chunkStoreView_.updateChunkStates(this.sliceCoords_, A.viewport), this.updateChunks(), this.resliceIfZChanged());
|
|
4104
4107
|
}
|
|
4105
4108
|
updateChunks() {
|
|
4106
|
-
if (!this.chunkStoreView_ || (this.state !== "ready" && this.setState("ready"), this.visibleChunks_.size > 0 && !this.chunkStoreView_.
|
|
4109
|
+
if (!this.chunkStoreView_ || (this.state !== "ready" && this.setState("ready"), this.visibleChunks_.size > 0 && !this.chunkStoreView_.allVisibleFallbackLODLoaded(this.sliceCoords_) && !this.isPresentationStale()))
|
|
4107
4110
|
return;
|
|
4108
4111
|
this.lastPresentationTimeStamp_ = performance.now(), this.lastPresentationTimeCoord_ = this.sliceCoords_.t;
|
|
4109
4112
|
const A = this.chunkStoreView_.getChunksToRender(
|