@loaders.gl/tiles 5.0.0-alpha.1 → 5.0.0-alpha.3
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/LICENSE +14 -3
- package/dist/dist.dev.js +17482 -3685
- package/dist/dist.min.js +4 -1
- package/dist/index.cjs +4594 -422
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +16 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/point-cloud/point-cloud-tile.d.ts.map +1 -1
- package/dist/point-cloud/point-cloud-tile.js +3 -0
- package/dist/point-cloud/point-cloud-tile.js.map +1 -1
- package/dist/point-cloud/point-cloud-tileset.d.ts +4 -0
- package/dist/point-cloud/point-cloud-tileset.d.ts.map +1 -1
- package/dist/point-cloud/point-cloud-tileset.js +54 -12
- package/dist/point-cloud/point-cloud-tileset.js.map +1 -1
- package/dist/point-cloud/types.d.ts +17 -0
- package/dist/point-cloud/types.d.ts.map +1 -1
- package/dist/point-cloud/types.js +3 -0
- package/dist/point-cloud/types.js.map +1 -1
- package/dist/raster-set.d.ts +37 -29
- package/dist/raster-set.d.ts.map +1 -1
- package/dist/raster-set.js +25 -2
- package/dist/raster-set.js.map +1 -1
- package/dist/spatial/format-spatial-reference.d.ts +67 -0
- package/dist/spatial/format-spatial-reference.d.ts.map +1 -0
- package/dist/spatial/format-spatial-reference.js +233 -0
- package/dist/spatial/format-spatial-reference.js.map +1 -0
- package/dist/spatial/get-spatial-coordinate-frame.d.ts +9 -0
- package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +1 -0
- package/dist/spatial/get-spatial-coordinate-frame.js +58 -0
- package/dist/spatial/get-spatial-coordinate-frame.js.map +1 -0
- package/dist/spatial/i3s-elevation.d.ts +20 -0
- package/dist/spatial/i3s-elevation.d.ts.map +1 -0
- package/dist/spatial/i3s-elevation.js +90 -0
- package/dist/spatial/i3s-elevation.js.map +1 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts +189 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts.map +1 -0
- package/dist/spatial/i3s-spatial-transformer.js +686 -0
- package/dist/spatial/i3s-spatial-transformer.js.map +1 -0
- package/dist/spatial/spatial-coordinate-transformer.d.ts +48 -0
- package/dist/spatial/spatial-coordinate-transformer.d.ts.map +1 -0
- package/dist/spatial/spatial-coordinate-transformer.js +211 -0
- package/dist/spatial/spatial-coordinate-transformer.js.map +1 -0
- package/dist/spatial/spatial-resource-registry.d.ts +44 -0
- package/dist/spatial/spatial-resource-registry.d.ts.map +1 -0
- package/dist/spatial/spatial-resource-registry.js +67 -0
- package/dist/spatial/spatial-resource-registry.js.map +1 -0
- package/dist/spatial/spatial-types.d.ts +190 -0
- package/dist/spatial/spatial-types.d.ts.map +1 -0
- package/dist/spatial/spatial-types.js +192 -0
- package/dist/spatial/spatial-types.js.map +1 -0
- package/dist/tileset-3d/common/tile-3d.d.ts +147 -4
- package/dist/tileset-3d/common/tile-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tile-3d.js +358 -76
- package/dist/tileset-3d/common/tile-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +168 -3
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.js +306 -23
- package/dist/tileset-3d/common/tileset-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-cache.d.ts +11 -1
- package/dist/tileset-3d/common/tileset-cache.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-cache.js +11 -3
- package/dist/tileset-3d/common/tileset-cache.js.map +1 -1
- package/dist/tileset-3d/common/tileset-source.d.ts +32 -0
- package/dist/tileset-3d/common/tileset-source.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-source.js.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts +19 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.js +39 -7
- package/dist/tileset-3d/common/tileset-traverser.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +136 -0
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +1 -0
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +384 -0
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +1 -0
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +86 -3
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +196 -21
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +36 -0
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +66 -0
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js +3 -0
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts +14 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.js +107 -17
- package/dist/tileset-3d/format-i3s/i3s-source.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js +3 -0
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js +3 -0
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +1 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.js +3 -0
- package/dist/tileset-3d/helpers/3d-tiles-options.js.map +1 -1
- package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/bounding-volume.js +4 -33
- package/dist/tileset-3d/helpers/bounding-volume.js.map +1 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts +62 -2
- package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/frame-state.js +85 -9
- package/dist/tileset-3d/helpers/frame-state.js.map +1 -1
- package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/i3s-lod.js +20 -8
- package/dist/tileset-3d/helpers/i3s-lod.js.map +1 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +61 -9
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.js +198 -93
- package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +134 -0
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +1 -0
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +179 -0
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/doubly-linked-list.d.ts.map +1 -1
- package/dist/utils/doubly-linked-list.js +1 -0
- package/dist/utils/doubly-linked-list.js.map +1 -1
- package/dist/utils/managed-array.d.ts.map +1 -1
- package/dist/utils/managed-array.js +1 -0
- package/dist/utils/managed-array.js.map +1 -1
- package/package.json +12 -9
- package/src/index.ts +61 -1
- package/src/point-cloud/point-cloud-tile.ts +4 -0
- package/src/point-cloud/point-cloud-tileset.ts +70 -12
- package/src/point-cloud/types.ts +21 -0
- package/src/raster-set.ts +118 -45
- package/src/spatial/format-spatial-reference.ts +311 -0
- package/src/spatial/get-spatial-coordinate-frame.ts +74 -0
- package/src/spatial/i3s-elevation.ts +96 -0
- package/src/spatial/i3s-spatial-transformer.ts +957 -0
- package/src/spatial/spatial-coordinate-transformer.ts +276 -0
- package/src/spatial/spatial-resource-registry.ts +79 -0
- package/src/spatial/spatial-types.ts +422 -0
- package/src/tileset-3d/common/tile-3d.ts +435 -84
- package/src/tileset-3d/common/tileset-3d.ts +445 -23
- package/src/tileset-3d/common/tileset-cache.ts +15 -7
- package/src/tileset-3d/common/tileset-source.ts +36 -0
- package/src/tileset-3d/common/tileset-traverser.ts +40 -7
- package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +612 -0
- package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +254 -21
- package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +77 -0
- package/src/tileset-3d/format-i3s/i3s-pending-tiles-register.ts +4 -0
- package/src/tileset-3d/format-i3s/i3s-source.ts +119 -18
- package/src/tileset-3d/format-i3s/i3s-tile-manager.ts +4 -0
- package/src/tileset-3d/format-i3s/i3s-tileset-traverser.ts +4 -0
- package/src/tileset-3d/helpers/3d-tiles-options.ts +4 -0
- package/src/tileset-3d/helpers/bounding-volume.ts +5 -55
- package/src/tileset-3d/helpers/frame-state.ts +142 -11
- package/src/tileset-3d/helpers/i3s-lod.ts +22 -8
- package/src/tileset-3d/helpers/tiles-3d-lod.ts +291 -112
- package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +301 -0
- package/src/types.ts +9 -0
- package/src/utils/doubly-linked-list.ts +2 -0
- package/src/utils/managed-array.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-3d.d.ts","sourceRoot":"","sources":["../../../src/tileset-3d/common/tile-3d.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,OAA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,7 +10,52 @@ import { createBoundingVolume, getCartographicBounds } from "../helpers/bounding
|
|
|
10
10
|
import { getTiles3DScreenSpaceError } from "../helpers/tiles-3d-lod.js";
|
|
11
11
|
import { getProjectedRadius } from "../helpers/i3s-lod.js";
|
|
12
12
|
import { TilesetTraverser } from "./tileset-traverser.js";
|
|
13
|
+
import { calculateFoveatedFactor, calculateTileRequestPriority, isFoveatedRequestDelayActive, isFoveatedRequestDeferred, isProgressiveResolutionPriority } from "../helpers/tiles-3d-request-priority.js";
|
|
13
14
|
const scratchVector = new Vector3();
|
|
15
|
+
/**
|
|
16
|
+
* Classifies render-content visibility across all content volumes owned by a tile.
|
|
17
|
+
*
|
|
18
|
+
* Content volumes form a union: one visible content entry keeps the tile renderable even when
|
|
19
|
+
* another entry is outside the frustum or clipping planes. The traversal volume is intentionally
|
|
20
|
+
* not used here except as a fallback when a tile has no content-specific volume. This separation
|
|
21
|
+
* keeps clipping render-only and prevents a tight content volume from pruning descendants.
|
|
22
|
+
*
|
|
23
|
+
* @param contentVolumes - Transformed content volumes in source order.
|
|
24
|
+
* @param fallbackVolume - Tile volume used when content does not declare its own volume.
|
|
25
|
+
* @param cullingVolume - Current view frustum.
|
|
26
|
+
* @param visibilityPlaneMask - Parent visibility mask optimization.
|
|
27
|
+
* @param clippingPlanes - Optional world-space planes applied to render content only.
|
|
28
|
+
* @returns Union visibility classification for the renderable content.
|
|
29
|
+
*/
|
|
30
|
+
export function getContentVisibility(contentVolumes, fallbackVolume, cullingVolume, visibilityPlaneMask, clippingPlanes = []) {
|
|
31
|
+
const volumes = contentVolumes.length ? contentVolumes : [fallbackVolume];
|
|
32
|
+
let visibleVolume = false;
|
|
33
|
+
let intersectingVolume = false;
|
|
34
|
+
for (const contentVolume of volumes) {
|
|
35
|
+
let visibility = 'inside';
|
|
36
|
+
if (visibilityPlaneMask !== CullingVolume.MASK_INSIDE) {
|
|
37
|
+
visibility = cullingVolume.computeVisibility(contentVolume);
|
|
38
|
+
if (visibility === 'outside') {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let clipped = false;
|
|
43
|
+
for (const clippingPlane of clippingPlanes) {
|
|
44
|
+
if (contentVolume.intersectPlane(clippingPlane) === 'outside') {
|
|
45
|
+
clipped = true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!clipped) {
|
|
50
|
+
visibleVolume = true;
|
|
51
|
+
intersectingVolume = intersectingVolume || visibility === 'intersecting';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!visibleVolume) {
|
|
55
|
+
return 'outside';
|
|
56
|
+
}
|
|
57
|
+
return intersectingVolume ? 'intersecting' : 'inside';
|
|
58
|
+
}
|
|
14
59
|
function defined(x) {
|
|
15
60
|
return x !== undefined && x !== null;
|
|
16
61
|
}
|
|
@@ -29,6 +74,8 @@ export class Tile3D {
|
|
|
29
74
|
refine;
|
|
30
75
|
type;
|
|
31
76
|
contentUrl;
|
|
77
|
+
/** Resolved render-content URLs in source order; empty for contentless tiles. */
|
|
78
|
+
contentUrls = [];
|
|
32
79
|
/** Different refinement algorithms used by I3S and 3D tiles */
|
|
33
80
|
lodMetricType = 'geometricError';
|
|
34
81
|
/**
|
|
@@ -48,10 +95,23 @@ export class Tile3D {
|
|
|
48
95
|
* not the content's metadata in the tileset JSON file.
|
|
49
96
|
*/
|
|
50
97
|
content = null;
|
|
98
|
+
/** Loaded payloads in the same order as {@link contentUrls}; `content` remains the primary payload. */
|
|
99
|
+
contents = [];
|
|
100
|
+
/**
|
|
101
|
+
* Metadata entity attached to this tile in the source tileset, if present.
|
|
102
|
+
*
|
|
103
|
+
* This is the raw 3D Tiles metadata reference. The generic tiles runtime preserves it without
|
|
104
|
+
* decoding schema classes or binary property tables.
|
|
105
|
+
*/
|
|
106
|
+
metadata = null;
|
|
107
|
+
/** Raw metadata entities attached to tile contents, in content source order. */
|
|
108
|
+
contentMetadata = [];
|
|
51
109
|
contentState = TILE_CONTENT_STATE.UNLOADED;
|
|
52
110
|
gpuMemoryUsageInBytes = 0;
|
|
53
111
|
/** The tile's children - an array of Tile3D objects. */
|
|
54
112
|
children = [];
|
|
113
|
+
/** Current lifecycle state for a lazy implicit subtree rooted at this tile. */
|
|
114
|
+
childrenState = 'ready';
|
|
55
115
|
depth = 0;
|
|
56
116
|
viewportIds = [];
|
|
57
117
|
transform = new Matrix4();
|
|
@@ -70,14 +130,39 @@ export class Tile3D {
|
|
|
70
130
|
// TODO Cesium 3d tiles specific
|
|
71
131
|
_expireDate = null;
|
|
72
132
|
_expiredContent = null;
|
|
133
|
+
/** In-flight source request shared by repeated traversal frames. */
|
|
134
|
+
_childrenPromise = null;
|
|
73
135
|
_boundingBox = undefined;
|
|
74
136
|
/** updated every frame for tree traversal and rendering optimizations: */
|
|
75
137
|
_distanceToCamera = 0;
|
|
76
138
|
_screenSpaceError = 0;
|
|
139
|
+
/** SSE calculated at the reduced viewport height used to prioritize coarse coverage. */
|
|
140
|
+
_screenSpaceErrorProgressiveResolution = 0;
|
|
141
|
+
/** Whether this tile should be promoted into the progressive-resolution request pass. */
|
|
142
|
+
_priorityProgressiveResolution = false;
|
|
143
|
+
/** Angular distance from the camera view axis used to prioritize center tiles. */
|
|
144
|
+
_foveatedFactor = 0;
|
|
145
|
+
/** Whether this peripheral request is currently inside the camera-motion deferral window. */
|
|
146
|
+
priorityDeferred = false;
|
|
77
147
|
_visibilityPlaneMask;
|
|
78
148
|
_visible = undefined;
|
|
79
149
|
_contentBoundingVolume;
|
|
150
|
+
_contentBoundingVolumes = [];
|
|
151
|
+
/** Source content-volume headers retained after render content is unloaded. */
|
|
152
|
+
_contentBoundingVolumeHeaders = [];
|
|
80
153
|
_viewerRequestVolume;
|
|
154
|
+
/** Bounding volume used to cull the tile's first renderable content entry. */
|
|
155
|
+
get contentBoundingVolume() {
|
|
156
|
+
return this._contentBoundingVolume;
|
|
157
|
+
}
|
|
158
|
+
/** All transformed render-content bounding volumes, including tile-volume fallbacks. */
|
|
159
|
+
get contentBoundingVolumes() {
|
|
160
|
+
return this._contentBoundingVolumes;
|
|
161
|
+
}
|
|
162
|
+
/** Bounding volume that limits when this tile may be requested, when declared. */
|
|
163
|
+
get viewerRequestVolume() {
|
|
164
|
+
return this._viewerRequestVolume;
|
|
165
|
+
}
|
|
81
166
|
_initialTransform = new Matrix4();
|
|
82
167
|
// Used by traverser, cannot be marked private
|
|
83
168
|
_priority = 0;
|
|
@@ -122,6 +207,13 @@ export class Tile3D {
|
|
|
122
207
|
this.refine = this._getRefine(header.refine);
|
|
123
208
|
this.type = header.type;
|
|
124
209
|
this.contentUrl = header.contentUrl;
|
|
210
|
+
this.contentUrls = header.contentUrls || (header.contentUrl ? [header.contentUrl] : []);
|
|
211
|
+
this.metadata = header.metadata || null;
|
|
212
|
+
const contentHeaders = Array.isArray(header.content) ? header.content : [header.content];
|
|
213
|
+
this.contentMetadata = contentHeaders
|
|
214
|
+
.filter(Boolean)
|
|
215
|
+
.map(contentHeader => contentHeader.metadata || null);
|
|
216
|
+
this.childrenState = header.implicitSubtree ? 'unloaded' : 'ready';
|
|
125
217
|
this._initializeLodMetric(header);
|
|
126
218
|
this._initializeTransforms(header);
|
|
127
219
|
this._updateLodMetricScale();
|
|
@@ -151,7 +243,18 @@ export class Tile3D {
|
|
|
151
243
|
}
|
|
152
244
|
/** Returns true if tile has children */
|
|
153
245
|
get hasChildren() {
|
|
154
|
-
return this.children.length > 0 ||
|
|
246
|
+
return (this.children.length > 0 ||
|
|
247
|
+
(this.header.children && this.header.children.length > 0) ||
|
|
248
|
+
Boolean(this.header.implicitSubtree && this.childrenState !== 'ready'));
|
|
249
|
+
}
|
|
250
|
+
/** Returns whether traversal may request an unresolved lazy child-header group. */
|
|
251
|
+
get hasUnloadedChildren() {
|
|
252
|
+
return Boolean(this.header.implicitSubtree &&
|
|
253
|
+
(this.childrenState === 'unloaded' || this.childrenState === 'failed'));
|
|
254
|
+
}
|
|
255
|
+
/** Returns whether a lazy child-header request is currently in flight. */
|
|
256
|
+
get childrenLoading() {
|
|
257
|
+
return this.childrenState === 'loading';
|
|
155
258
|
}
|
|
156
259
|
/**
|
|
157
260
|
* Determines if the tile's content is ready. This is automatically `true` for
|
|
@@ -212,13 +315,23 @@ export class Tile3D {
|
|
|
212
315
|
}
|
|
213
316
|
return this._boundingBox;
|
|
214
317
|
}
|
|
215
|
-
/**
|
|
216
|
-
|
|
318
|
+
/**
|
|
319
|
+
* Gets the tile's screen-space error for normal refinement or a reduced-height priority pass.
|
|
320
|
+
*
|
|
321
|
+
* I3S already supplies a screen-oriented LOD metric and intentionally ignores the optional 3D
|
|
322
|
+
* Tiles progressive-resolution height fraction.
|
|
323
|
+
*
|
|
324
|
+
* @param frameState - Current camera and viewport measurements.
|
|
325
|
+
* @param useParentLodMetric - Whether to substitute the parent LOD metric.
|
|
326
|
+
* @param viewportHeightFraction - Fraction of viewport height represented by the priority pass.
|
|
327
|
+
* @returns Screen-space LOD error for the current tileset format.
|
|
328
|
+
*/
|
|
329
|
+
getScreenSpaceError(frameState, useParentLodMetric, viewportHeightFraction = 1) {
|
|
217
330
|
switch (this.tileset.type) {
|
|
218
331
|
case TILESET_TYPE.I3S:
|
|
219
332
|
return getProjectedRadius(this, frameState);
|
|
220
333
|
case TILESET_TYPE.TILES3D:
|
|
221
|
-
return getTiles3DScreenSpaceError(this, frameState, useParentLodMetric);
|
|
334
|
+
return getTiles3DScreenSpaceError(this, frameState, useParentLodMetric, viewportHeightFraction);
|
|
222
335
|
default:
|
|
223
336
|
// eslint-disable-next-line
|
|
224
337
|
throw new Error('Unsupported tileset type');
|
|
@@ -235,14 +348,37 @@ export class Tile3D {
|
|
|
235
348
|
* Memory usage of tile on GPU
|
|
236
349
|
*/
|
|
237
350
|
_getGpuMemoryUsageInBytes() {
|
|
238
|
-
|
|
351
|
+
const contents = this.contents.length ? this.contents : [this.content];
|
|
352
|
+
return contents.reduce((total, content) => total + (content?.gpuMemoryUsageInBytes || content?.byteLength || 0), 0);
|
|
239
353
|
}
|
|
240
|
-
|
|
241
|
-
*
|
|
242
|
-
*
|
|
354
|
+
/**
|
|
355
|
+
* Returns scheduler priority for render-content requests.
|
|
356
|
+
*
|
|
357
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
243
358
|
*/
|
|
244
|
-
// eslint-disable-next-line complexity
|
|
245
359
|
_getPriority() {
|
|
360
|
+
return this._calculateRequestPriority(false);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Returns scheduler priority for lazy child-header requests.
|
|
364
|
+
*
|
|
365
|
+
* Contentless implicit placeholders intentionally retain `UNLOADED` content state, so metadata
|
|
366
|
+
* scheduling skips only that render-content cancellation check and preserves every visibility,
|
|
367
|
+
* recency, progressive, foveated, and motion-deferral rule.
|
|
368
|
+
*
|
|
369
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
370
|
+
*/
|
|
371
|
+
_getChildrenPriority() {
|
|
372
|
+
return this._calculateRequestPriority(true);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Calculates the common scheduler priority for content or hierarchy metadata.
|
|
376
|
+
*
|
|
377
|
+
* @param allowUnloadedContent - Whether an empty placeholder may request child metadata.
|
|
378
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
379
|
+
*/
|
|
380
|
+
// eslint-disable-next-line complexity
|
|
381
|
+
_calculateRequestPriority(allowUnloadedContent) {
|
|
246
382
|
const traverser = this.tileset._traverser;
|
|
247
383
|
const { skipLevelOfDetail } = traverser.options;
|
|
248
384
|
/*
|
|
@@ -260,7 +396,13 @@ export class Tile3D {
|
|
|
260
396
|
if (this.tileset._frameNumber - this._touchedFrame >= 1) {
|
|
261
397
|
return -1;
|
|
262
398
|
}
|
|
263
|
-
|
|
399
|
+
// RequestScheduler re-evaluates this callback before a queued request receives a slot. A
|
|
400
|
+
// negative priority cancels work that became deferred after it was queued; the scheduled
|
|
401
|
+
// follow-up traversal submits it again after the motion delay expires.
|
|
402
|
+
if (this.priorityDeferred) {
|
|
403
|
+
return -1;
|
|
404
|
+
}
|
|
405
|
+
if (!allowUnloadedContent && this.contentState === TILE_CONTENT_STATE.UNLOADED) {
|
|
264
406
|
return -1;
|
|
265
407
|
}
|
|
266
408
|
// Based on the priority function `getPriorityReverseScreenSpaceError` in CesiumJS. Scheduling priority is based on the parent's screen space error when possible.
|
|
@@ -270,8 +412,15 @@ export class Tile3D {
|
|
|
270
412
|
? parent._screenSpaceError
|
|
271
413
|
: this._screenSpaceError;
|
|
272
414
|
const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;
|
|
273
|
-
// Map higher SSE to lower values (e.g. root tile is highest priority)
|
|
274
|
-
|
|
415
|
+
// Map higher SSE to lower values (e.g. root tile is highest priority), then combine the
|
|
416
|
+
// existing order with independent progressive and foveated priority bands.
|
|
417
|
+
const reverseScreenSpaceError = Math.max(rootScreenSpaceError - screenSpaceError, 0);
|
|
418
|
+
return calculateTileRequestPriority({
|
|
419
|
+
priorityProgressiveResolution: this._priorityProgressiveResolution,
|
|
420
|
+
foveatedFactor: this._foveatedFactor,
|
|
421
|
+
reverseScreenSpaceError,
|
|
422
|
+
rootScreenSpaceError
|
|
423
|
+
});
|
|
275
424
|
}
|
|
276
425
|
/**
|
|
277
426
|
* Requests the tile's content.
|
|
@@ -298,6 +447,10 @@ export class Tile3D {
|
|
|
298
447
|
}
|
|
299
448
|
try {
|
|
300
449
|
const loadResult = await this.tileset.source.loadTileContent(this);
|
|
450
|
+
if (loadResult.contents) {
|
|
451
|
+
this.contents = loadResult.contents;
|
|
452
|
+
this.content = this.contents[0] || null;
|
|
453
|
+
}
|
|
301
454
|
if (this.tileset.options.contentLoader) {
|
|
302
455
|
await this.tileset.options.contentLoader(this);
|
|
303
456
|
}
|
|
@@ -314,11 +467,100 @@ export class Tile3D {
|
|
|
314
467
|
requestToken.done();
|
|
315
468
|
}
|
|
316
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Requests and installs this tile's lazy child-header group through its source.
|
|
472
|
+
*
|
|
473
|
+
* The same request scheduler and SSE/foveated priority value used for render content are reused
|
|
474
|
+
* for subtree metadata. Repeated traversal frames share one promise, and scheduler cancellation
|
|
475
|
+
* restores the unloaded state so a later frame can retry.
|
|
476
|
+
*
|
|
477
|
+
* @param frameState - View state that made the subtree eligible for refinement.
|
|
478
|
+
* @returns Source load result, or an unloaded result if scheduling was cancelled.
|
|
479
|
+
*/
|
|
480
|
+
async loadChildren(frameState) {
|
|
481
|
+
if (!this.header.implicitSubtree || this.childrenState === 'ready') {
|
|
482
|
+
return { loaded: false, tileCount: 0, childSubtreeCount: 0 };
|
|
483
|
+
}
|
|
484
|
+
if (this._childrenPromise) {
|
|
485
|
+
return await this._childrenPromise;
|
|
486
|
+
}
|
|
487
|
+
if (!this.tileset.source.loadTileChildren) {
|
|
488
|
+
throw new Error('Tileset source does not support lazy tile children');
|
|
489
|
+
}
|
|
490
|
+
this.childrenState = 'loading';
|
|
491
|
+
this._childrenPromise = this._loadChildrenWithScheduler(frameState);
|
|
492
|
+
try {
|
|
493
|
+
return await this._childrenPromise;
|
|
494
|
+
}
|
|
495
|
+
finally {
|
|
496
|
+
this._childrenPromise = null;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Runs one lazy child-header load after obtaining a scheduler token.
|
|
501
|
+
*
|
|
502
|
+
* @param frameState - View state forwarded to the source implementation.
|
|
503
|
+
* @returns Source load result.
|
|
504
|
+
*/
|
|
505
|
+
async _loadChildrenWithScheduler(frameState) {
|
|
506
|
+
const requestToken = await this.tileset._requestScheduler.scheduleRequest(`${this.id}:implicit-subtree`, this._getChildrenPriority.bind(this));
|
|
507
|
+
if (!requestToken) {
|
|
508
|
+
this.childrenState = 'unloaded';
|
|
509
|
+
return { loaded: false, tileCount: 0, childSubtreeCount: 0 };
|
|
510
|
+
}
|
|
511
|
+
try {
|
|
512
|
+
const loadResult = await this.tileset.source.loadTileChildren(this, frameState);
|
|
513
|
+
this.childrenState = loadResult.loaded ? 'ready' : 'unloaded';
|
|
514
|
+
return loadResult;
|
|
515
|
+
}
|
|
516
|
+
catch (error) {
|
|
517
|
+
this.childrenState = 'failed';
|
|
518
|
+
throw error;
|
|
519
|
+
}
|
|
520
|
+
finally {
|
|
521
|
+
requestToken.done();
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Replaces a contentless implicit placeholder with its materialized subtree-root header.
|
|
526
|
+
*
|
|
527
|
+
* Transform state is intentionally preserved: the placeholder already owns the composed
|
|
528
|
+
* transform, and reapplying the root transform here would double-transform bounds and geometric
|
|
529
|
+
* error. Content and raw geometric error are reinitialized from the newly available header.
|
|
530
|
+
*
|
|
531
|
+
* @param materializedHeader - Available root header produced from one subtree resource.
|
|
532
|
+
*/
|
|
533
|
+
applyImplicitSubtreeHeader(materializedHeader) {
|
|
534
|
+
const existingTransform = this.header.transform;
|
|
535
|
+
const existingTransformMatrix = this.header.transformMatrix;
|
|
536
|
+
this.header = {
|
|
537
|
+
...this.header,
|
|
538
|
+
...materializedHeader,
|
|
539
|
+
transform: existingTransform,
|
|
540
|
+
transformMatrix: existingTransformMatrix,
|
|
541
|
+
implicitSubtree: undefined
|
|
542
|
+
};
|
|
543
|
+
this.refine = this._getRefine(materializedHeader.refine);
|
|
544
|
+
this.type = materializedHeader.type;
|
|
545
|
+
this.contentUrl = materializedHeader.contentUrl;
|
|
546
|
+
this.contentUrls =
|
|
547
|
+
materializedHeader.contentUrls ||
|
|
548
|
+
(materializedHeader.contentUrl ? [materializedHeader.contentUrl] : []);
|
|
549
|
+
this._initializeLodMetric(materializedHeader);
|
|
550
|
+
this._updateLodMetricScale();
|
|
551
|
+
this._initializeBoundingVolumes(this.header);
|
|
552
|
+
// Use the merged header so inherited viewer-request-volume metadata remains available when a
|
|
553
|
+
// materialized implicit tile has no render content of its own.
|
|
554
|
+
this._initializeContent(this.header);
|
|
555
|
+
}
|
|
317
556
|
// Unloads the tile's content.
|
|
318
557
|
unloadContent() {
|
|
319
|
-
|
|
320
|
-
|
|
558
|
+
for (const content of this.contents.length ? this.contents : [this.content]) {
|
|
559
|
+
if (content && content.destroy) {
|
|
560
|
+
content.destroy();
|
|
561
|
+
}
|
|
321
562
|
}
|
|
563
|
+
this.contents = [];
|
|
322
564
|
this.content = null;
|
|
323
565
|
if (this.header.content && this.header.content.destroy) {
|
|
324
566
|
this.header.content.destroy();
|
|
@@ -350,12 +592,59 @@ export class Tile3D {
|
|
|
350
592
|
}
|
|
351
593
|
this._distanceToCamera = this.distanceToTile(frameState);
|
|
352
594
|
this._screenSpaceError = this.getScreenSpaceError(frameState, false);
|
|
595
|
+
this._updateRequestPriorityMetrics(frameState);
|
|
353
596
|
this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask); // Use parent's plane mask to speed up visibility test
|
|
354
597
|
this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;
|
|
355
598
|
this._inRequestVolume = this.insideViewerRequestVolume(frameState);
|
|
356
599
|
this._frameNumber = frameState.frameNumber;
|
|
357
600
|
this.viewportIds = viewportIds;
|
|
358
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* Updates progressive-resolution and foveated request metrics for a 3D Tiles traversal frame.
|
|
604
|
+
*
|
|
605
|
+
* I3S retains its format-specific screen-threshold ordering and is explicitly isolated from
|
|
606
|
+
* geometric-error scheduling. Orthographic viewports still receive progressive coverage, but
|
|
607
|
+
* angular foveation is disabled because an orthographic frustum has no perspective field of view.
|
|
608
|
+
*
|
|
609
|
+
* @param frameState - Current camera and viewport measurements.
|
|
610
|
+
*/
|
|
611
|
+
_updateRequestPriorityMetrics(frameState) {
|
|
612
|
+
if (this.tileset.type !== TILESET_TYPE.TILES3D) {
|
|
613
|
+
this._screenSpaceErrorProgressiveResolution = this._screenSpaceError;
|
|
614
|
+
this._priorityProgressiveResolution = false;
|
|
615
|
+
this._foveatedFactor = 0;
|
|
616
|
+
this.priorityDeferred = false;
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const options = this.tileset.options;
|
|
620
|
+
const progressiveResolutionHeightFraction = options.progressiveResolutionHeightFraction;
|
|
621
|
+
this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError(frameState, false, progressiveResolutionHeightFraction);
|
|
622
|
+
this._priorityProgressiveResolution = isProgressiveResolutionPriority(this._screenSpaceErrorProgressiveResolution, this.parent?._screenSpaceErrorProgressiveResolution, this.tileset.memoryAdjustedScreenSpaceError, progressiveResolutionHeightFraction);
|
|
623
|
+
if (!options.foveatedScreenSpaceError ||
|
|
624
|
+
frameState.viewport?.orthographic ||
|
|
625
|
+
!frameState.camera?.position ||
|
|
626
|
+
!frameState.camera?.direction) {
|
|
627
|
+
this._foveatedFactor = 0;
|
|
628
|
+
this.priorityDeferred = false;
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
this._foveatedFactor = calculateFoveatedFactor(this.boundingVolume, frameState.camera);
|
|
632
|
+
const deferralEligible = isFoveatedRequestDeferred({
|
|
633
|
+
refinement: this.refine,
|
|
634
|
+
skipLevelOfDetail: this.tileset._traverser.options.skipLevelOfDetail,
|
|
635
|
+
foveatedScreenSpaceError: options.foveatedScreenSpaceError,
|
|
636
|
+
foveatedConeSize: options.foveatedConeSize,
|
|
637
|
+
minimumScreenSpaceErrorRelaxation: options.foveatedMinimumScreenSpaceErrorRelaxation,
|
|
638
|
+
interpolationCallback: options.foveatedInterpolationCallback,
|
|
639
|
+
foveatedFactor: this._foveatedFactor,
|
|
640
|
+
verticalFieldOfView: frameState.camera.verticalFieldOfView,
|
|
641
|
+
screenSpaceError: this._screenSpaceError,
|
|
642
|
+
parentScreenSpaceError: this.parent?._screenSpaceError,
|
|
643
|
+
maximumScreenSpaceError: this.tileset.memoryAdjustedScreenSpaceError,
|
|
644
|
+
priorityProgressiveResolution: this._priorityProgressiveResolution
|
|
645
|
+
});
|
|
646
|
+
this.priorityDeferred = isFoveatedRequestDelayActive(deferralEligible, frameState.camera.timeSinceMovement, options.foveatedTimeDelay);
|
|
647
|
+
}
|
|
359
648
|
// Determines whether the tile's bounding volume intersects the culling volume.
|
|
360
649
|
// @param {FrameState} frameState The frame state.
|
|
361
650
|
// @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.
|
|
@@ -378,46 +667,16 @@ export class Tile3D {
|
|
|
378
667
|
// return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
|
|
379
668
|
return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
|
|
380
669
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (!defined(this.contentBoundingVolume)) {
|
|
392
|
-
return Intersect.INSIDE;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {
|
|
396
|
-
// The tile's bounding volume is completely inside the culling volume so
|
|
397
|
-
// the content bounding volume must also be inside.
|
|
398
|
-
return Intersect.INSIDE;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
// PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the
|
|
402
|
-
// tile's (not the content's) bounding volume intersects the culling volume?
|
|
403
|
-
const cullingVolume = frameState.cullingVolume;
|
|
404
|
-
const boundingVolume = tile.contentBoundingVolume;
|
|
405
|
-
|
|
406
|
-
const tileset = this.tileset;
|
|
407
|
-
const clippingPlanes = tileset.clippingPlanes;
|
|
408
|
-
if (defined(clippingPlanes) && clippingPlanes.enabled) {
|
|
409
|
-
const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
|
|
410
|
-
boundingVolume,
|
|
411
|
-
tileset.clippingPlanesOriginMatrix
|
|
412
|
-
);
|
|
413
|
-
this._isClipped = intersection !== Intersect.INSIDE;
|
|
414
|
-
if (intersection === Intersect.OUTSIDE) {
|
|
415
|
-
return Intersect.OUTSIDE;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
return cullingVolume.computeVisibility(boundingVolume);
|
|
420
|
-
*/
|
|
670
|
+
/**
|
|
671
|
+
* Determines whether renderable content intersects the view and configured clipping planes.
|
|
672
|
+
*
|
|
673
|
+
* Clipping planes are render-only constraints; traversal continues to use the tile volume.
|
|
674
|
+
*
|
|
675
|
+
* @param frameState Current camera, culling, and optional clipping-plane state.
|
|
676
|
+
* @returns The content visibility classification.
|
|
677
|
+
*/
|
|
678
|
+
contentVisibility(frameState) {
|
|
679
|
+
return getContentVisibility(this._contentBoundingVolumes, this.boundingVolume, frameState.cullingVolume, this._visibilityPlaneMask, frameState.clippingPlanes);
|
|
421
680
|
}
|
|
422
681
|
/**
|
|
423
682
|
* Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
|
|
@@ -522,18 +781,20 @@ export class Tile3D {
|
|
|
522
781
|
}
|
|
523
782
|
_initializeBoundingVolumes(tileHeader) {
|
|
524
783
|
this._contentBoundingVolume = null;
|
|
784
|
+
this._contentBoundingVolumeHeaders = [];
|
|
525
785
|
this._viewerRequestVolume = null;
|
|
526
786
|
this._updateBoundingVolume(tileHeader);
|
|
527
787
|
}
|
|
528
788
|
_initializeContent(tileHeader) {
|
|
529
789
|
// Empty tile by default
|
|
530
790
|
this.content = { _tileset: this.tileset, _tile: this };
|
|
791
|
+
this.contents = [];
|
|
531
792
|
this.hasEmptyContent = true;
|
|
532
793
|
this.contentState = TILE_CONTENT_STATE.UNLOADED;
|
|
533
794
|
// When `true`, the tile's content points to an external tileset.
|
|
534
795
|
// This is `false` until the tile's content is loaded.
|
|
535
796
|
this.hasTilesetContent = false;
|
|
536
|
-
if (tileHeader.contentUrl) {
|
|
797
|
+
if (tileHeader.contentUrl || tileHeader.contentUrls?.length) {
|
|
537
798
|
this.content = null;
|
|
538
799
|
this.hasEmptyContent = false;
|
|
539
800
|
}
|
|
@@ -546,6 +807,10 @@ export class Tile3D {
|
|
|
546
807
|
this._distanceToCamera = 0;
|
|
547
808
|
this._centerZDepth = 0;
|
|
548
809
|
this._screenSpaceError = 0;
|
|
810
|
+
this._screenSpaceErrorProgressiveResolution = 0;
|
|
811
|
+
this._priorityProgressiveResolution = false;
|
|
812
|
+
this._foveatedFactor = 0;
|
|
813
|
+
this.priorityDeferred = false;
|
|
549
814
|
this._visibilityPlaneMask = CullingVolume.MASK_INDETERMINATE;
|
|
550
815
|
this._visible = undefined;
|
|
551
816
|
this._inRequestVolume = false;
|
|
@@ -562,18 +827,28 @@ export class Tile3D {
|
|
|
562
827
|
// Inherit from parent tile if omitted.
|
|
563
828
|
return refine || (this.parent && this.parent.refine) || TILE_REFINEMENT.REPLACE;
|
|
564
829
|
}
|
|
830
|
+
/**
|
|
831
|
+
* Returns whether loaded content is an external tileset.
|
|
832
|
+
*
|
|
833
|
+
* Parsed shape is authoritative because valid external resources may be extensionless, signed,
|
|
834
|
+
* or use a misleading filename. This method is called only after source loading has populated
|
|
835
|
+
* `content`.
|
|
836
|
+
*/
|
|
565
837
|
_isTileset() {
|
|
566
|
-
return this.
|
|
838
|
+
return (this.contents.length ? this.contents : [this.content]).some(content => content?.shape === 'tileset3d');
|
|
567
839
|
}
|
|
568
840
|
_onContentLoaded() {
|
|
569
841
|
// Vector and Geometry tile rendering do not support the skip LOD optimization.
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
842
|
+
const contents = this.contents.length ? this.contents : [this.content];
|
|
843
|
+
for (const content of contents) {
|
|
844
|
+
switch (content && content.type) {
|
|
845
|
+
case 'vctr':
|
|
846
|
+
case 'geom':
|
|
847
|
+
// @ts-ignore
|
|
848
|
+
this.tileset._traverser.disableSkipLevelOfDetail = true;
|
|
849
|
+
break;
|
|
850
|
+
default:
|
|
851
|
+
}
|
|
577
852
|
}
|
|
578
853
|
// The content may be tileset json
|
|
579
854
|
if (this._isTileset()) {
|
|
@@ -586,22 +861,29 @@ export class Tile3D {
|
|
|
586
861
|
_updateBoundingVolume(header) {
|
|
587
862
|
// Update the bounding volumes
|
|
588
863
|
this.boundingVolume = createBoundingVolume(header.boundingVolume, this.computedTransform, this.boundingVolume);
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
// TODO Cesium specific
|
|
594
|
-
// Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume
|
|
595
|
-
// around only the features in the tile. This box is useful for culling for rendering,
|
|
596
|
-
// but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,
|
|
597
|
-
// since it only bounds features in the tile, not the entire tile, children may be
|
|
598
|
-
// outside of this box.
|
|
599
|
-
if (content.boundingVolume) {
|
|
600
|
-
this._contentBoundingVolume = createBoundingVolume(content.boundingVolume, this.computedTransform, this._contentBoundingVolume);
|
|
601
|
-
}
|
|
864
|
+
// Viewer request volumes constrain traversal, not just render content. A contentless implicit
|
|
865
|
+
// connector can still own an inherited request volume, so initialize it before the
|
|
866
|
+
// content-specific early return below.
|
|
602
867
|
if (header.viewerRequestVolume) {
|
|
603
868
|
this._viewerRequestVolume = createBoundingVolume(header.viewerRequestVolume, this.computedTransform, this._viewerRequestVolume);
|
|
604
869
|
}
|
|
870
|
+
const content = header.content;
|
|
871
|
+
if (content) {
|
|
872
|
+
this._contentBoundingVolumeHeaders = Array.isArray(content) ? content : [content];
|
|
873
|
+
}
|
|
874
|
+
const contentHeaders = content
|
|
875
|
+
? Array.isArray(content)
|
|
876
|
+
? content
|
|
877
|
+
: [content]
|
|
878
|
+
: this._contentBoundingVolumeHeaders;
|
|
879
|
+
// Preserve source order: an unbounded content entry uses the tile volume at its
|
|
880
|
+
// corresponding index rather than being appended after bounded sibling entries.
|
|
881
|
+
this._contentBoundingVolumes = contentHeaders.length
|
|
882
|
+
? contentHeaders.map(headerEntry => headerEntry?.boundingVolume
|
|
883
|
+
? createBoundingVolume(headerEntry.boundingVolume, this.computedTransform)
|
|
884
|
+
: this.boundingVolume)
|
|
885
|
+
: [this.boundingVolume];
|
|
886
|
+
this._contentBoundingVolume = this._contentBoundingVolumes[0] || null;
|
|
605
887
|
}
|
|
606
888
|
/**
|
|
607
889
|
* Updates the tile's computed transform, world-space geometric error, and bounding volumes.
|