@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
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { type ReadonlyCRSDefinition, type SpatialReference, type SpatialReferenceAlternative, type SpatialReferenceCoordinateFrame, type SpatialReferenceProvenance, type SpatialReferenceRepresentation, type SpatialReferenceState } from '@math.gl/crs';
|
|
2
|
+
import type { Geoid } from '@math.gl/geoid';
|
|
3
|
+
/** How height values in a 3D dataset relate to the earth. */
|
|
4
|
+
export type TilesetHeightReference = 'native' | 'ellipsoidal' | 'orthometric' | 'unknown';
|
|
5
|
+
/** Height reference that an application may request for transformed output. */
|
|
6
|
+
export type TilesetTargetHeightReference = 'native' | 'ellipsoidal' | 'orthometric';
|
|
7
|
+
/** I3S placement rule applied after source-height interpretation. */
|
|
8
|
+
export type TilesetElevationMode = 'absoluteHeight' | 'onTheGround' | 'relativeToGround' | 'relativeToScene';
|
|
9
|
+
/** One WGS84 longitude/latitude location requested from an elevation provider. */
|
|
10
|
+
export type TilesetElevationSample = readonly [longitude: number, latitude: number];
|
|
11
|
+
/** WGS84 geographic footprint passed to an elevation provider. */
|
|
12
|
+
export type TilesetElevationBounds = {
|
|
13
|
+
/** Western longitude in degrees. Greater than `east` when crossing the antimeridian. */
|
|
14
|
+
readonly west: number;
|
|
15
|
+
/** Southern latitude in degrees. */
|
|
16
|
+
readonly south: number;
|
|
17
|
+
/** Eastern longitude in degrees. Less than `west` when crossing the antimeridian. */
|
|
18
|
+
readonly east: number;
|
|
19
|
+
/** Northern latitude in degrees. */
|
|
20
|
+
readonly north: number;
|
|
21
|
+
};
|
|
22
|
+
/** Conservative elevation extrema over one geographic footprint. */
|
|
23
|
+
export type TilesetElevationRange = {
|
|
24
|
+
/** Minimum elevation anywhere inside the footprint. */
|
|
25
|
+
readonly minimum: number;
|
|
26
|
+
/** Maximum elevation anywhere inside the footprint. */
|
|
27
|
+
readonly maximum: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Application-owned source of terrain or scene-surface heights.
|
|
31
|
+
*
|
|
32
|
+
* Providers receive WGS84 longitude/latitude locations and may batch asynchronous requests. They
|
|
33
|
+
* never need to transform horizontal coordinates. Returned heights default to meters in the
|
|
34
|
+
* layer's source height reference unless `unit` or `heightReference` says otherwise.
|
|
35
|
+
*/
|
|
36
|
+
export type TilesetElevationProvider = {
|
|
37
|
+
/** Height reference used by sampled values. Omit to use the layer's source height reference. */
|
|
38
|
+
readonly heightReference?: Exclude<TilesetHeightReference, 'native' | 'unknown'>;
|
|
39
|
+
/** Linear unit used by sampled values. Defaults to `meter`. */
|
|
40
|
+
readonly unit?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Samples one height for every supplied location, preserving input order.
|
|
43
|
+
* @param positions - WGS84 longitude/latitude locations.
|
|
44
|
+
* @returns Finite heights with the same length and order as `positions`.
|
|
45
|
+
*/
|
|
46
|
+
sampleElevations(positions: readonly TilesetElevationSample[]): readonly number[] | Promise<readonly number[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns conservative elevation extrema over an entire geographic footprint.
|
|
49
|
+
*
|
|
50
|
+
* Bounds preparation requires this operation because point samples cannot detect an interior
|
|
51
|
+
* peak or depression and therefore cannot produce a culling-safe traversal volume.
|
|
52
|
+
*
|
|
53
|
+
* @param bounds - WGS84 geographic footprint in degrees.
|
|
54
|
+
* @returns Minimum and maximum elevations in this provider's declared unit and height reference.
|
|
55
|
+
*/
|
|
56
|
+
getElevationRange(bounds: TilesetElevationBounds): TilesetElevationRange | Promise<TilesetElevationRange>;
|
|
57
|
+
};
|
|
58
|
+
/** Coordinate representation requested from a 3D tileset. */
|
|
59
|
+
export type TilesetOutputCoordinates = 'auto' | 'ecef' | 'local-enu' | 'target-crs';
|
|
60
|
+
/** Broad coordinate frame used by a 3D dataset. */
|
|
61
|
+
export type TilesetCoordinateFrame = SpatialReferenceCoordinateFrame;
|
|
62
|
+
/** Origin of a normalized spatial-reference value. */
|
|
63
|
+
export type TilesetSpatialReferenceProvenance = SpatialReferenceProvenance;
|
|
64
|
+
/**
|
|
65
|
+
* Simple application-facing spatial options shared by 3D Tiles and I3S.
|
|
66
|
+
*
|
|
67
|
+
* Source CRS details are normally discovered from dataset metadata. The source overrides are
|
|
68
|
+
* expert recovery controls for incomplete or non-standard datasets.
|
|
69
|
+
*/
|
|
70
|
+
export type TilesetSpatialOptions = {
|
|
71
|
+
/** CRS of transformed output coordinates. Omit to retain the format's natural world frame. */
|
|
72
|
+
targetCrs?: ReadonlyCRSDefinition;
|
|
73
|
+
/** Height reference of transformed output coordinates. Defaults to `native`. */
|
|
74
|
+
targetHeightReference?: TilesetTargetHeightReference;
|
|
75
|
+
/** Output coordinate representation. Defaults to `auto`. */
|
|
76
|
+
outputCoordinates?: TilesetOutputCoordinates;
|
|
77
|
+
/** Expert override used when source metadata is absent or incorrect. */
|
|
78
|
+
sourceCrs?: ReadonlyCRSDefinition;
|
|
79
|
+
/** Expert override for a dynamic coordinate reference epoch. */
|
|
80
|
+
coordinateEpoch?: number;
|
|
81
|
+
/** Registered geoid model name or an already parsed geoid model. */
|
|
82
|
+
geoidModel?: string | Geoid;
|
|
83
|
+
/** Terrain heights used by I3S `onTheGround` and `relativeToGround` placement. */
|
|
84
|
+
terrainElevationProvider?: TilesetElevationProvider;
|
|
85
|
+
/** Scene-surface heights used by I3S `relativeToScene` placement. */
|
|
86
|
+
sceneElevationProvider?: TilesetElevationProvider;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Normalized, readonly spatial metadata discovered for a 3D tileset.
|
|
90
|
+
*
|
|
91
|
+
* This is diagnostic output. Applications normally do not construct it.
|
|
92
|
+
*/
|
|
93
|
+
export type TilesetSpatialReference = SpatialReference & {
|
|
94
|
+
/** Source horizontal or compound CRS, when it can be identified. */
|
|
95
|
+
readonly sourceCrs?: ReadonlyCRSDefinition;
|
|
96
|
+
/** Source vertical CRS, when independently identified. */
|
|
97
|
+
readonly verticalCrs?: ReadonlyCRSDefinition;
|
|
98
|
+
/** Number of meters represented by one source Z unit. */
|
|
99
|
+
readonly verticalUnitScale: number;
|
|
100
|
+
/** Coordinate epoch attached to the source coordinates. */
|
|
101
|
+
readonly coordinateEpoch?: number;
|
|
102
|
+
/** Source height interpretation. */
|
|
103
|
+
readonly heightReference: TilesetHeightReference;
|
|
104
|
+
/** I3S placement rule, when the source layer declares one. */
|
|
105
|
+
readonly elevationMode?: TilesetElevationMode;
|
|
106
|
+
/** Declared I3S elevation offset before unit normalization. */
|
|
107
|
+
readonly elevationOffset?: number;
|
|
108
|
+
/** Unit of the I3S elevation offset. Defaults to `meter` when a mode is declared. */
|
|
109
|
+
readonly elevationUnit?: string;
|
|
110
|
+
/** Number of meters represented by one elevation-offset unit. */
|
|
111
|
+
readonly elevationUnitScale: number;
|
|
112
|
+
/** Broad frame in which source coordinates are encoded. */
|
|
113
|
+
readonly coordinateFrame: TilesetCoordinateFrame;
|
|
114
|
+
/** Coordinate component order used by the format wire representation. */
|
|
115
|
+
readonly axisOrder: 'xy' | 'yx' | 'xyz' | 'unknown';
|
|
116
|
+
/** How the source CRS was established. */
|
|
117
|
+
readonly provenance: TilesetSpatialReferenceProvenance;
|
|
118
|
+
/** Target CRS selected by application options, if any. */
|
|
119
|
+
readonly targetCrs?: ReadonlyCRSDefinition;
|
|
120
|
+
/** Target height interpretation selected by application options. */
|
|
121
|
+
readonly targetHeightReference: TilesetTargetHeightReference;
|
|
122
|
+
/** Output representation selected by application options. */
|
|
123
|
+
readonly outputCoordinates: TilesetOutputCoordinates;
|
|
124
|
+
/** Whether coordinates are native, ready to transform, transformed, or unresolved. */
|
|
125
|
+
readonly status: 'native' | 'transformable' | 'transformed' | 'unresolved';
|
|
126
|
+
/** Non-fatal qualifications retained for diagnostics and user interfaces. */
|
|
127
|
+
readonly warnings: readonly string[];
|
|
128
|
+
};
|
|
129
|
+
/** Input used by format adapters to create normalized spatial metadata. */
|
|
130
|
+
export type CreateTilesetSpatialReferenceOptions = {
|
|
131
|
+
/** Discovered source CRS. */
|
|
132
|
+
sourceCrs?: ReadonlyCRSDefinition;
|
|
133
|
+
/** Whether the source CRS was explicit, defaulted, unknown, or absent. */
|
|
134
|
+
sourceCrsState?: SpatialReferenceState;
|
|
135
|
+
/** Serialization or naming form used by the source CRS. */
|
|
136
|
+
sourceCrsRepresentation?: SpatialReferenceRepresentation;
|
|
137
|
+
/** Additional source CRS representations retained by the format. */
|
|
138
|
+
sourceCrsAlternatives?: readonly SpatialReferenceAlternative[];
|
|
139
|
+
/** Discovered vertical CRS. */
|
|
140
|
+
verticalCrs?: ReadonlyCRSDefinition;
|
|
141
|
+
/** Per-component source units, aligned with the stored coordinate order. */
|
|
142
|
+
units?: readonly string[];
|
|
143
|
+
/** Number of meters represented by one discovered source Z unit. */
|
|
144
|
+
verticalUnitScale?: number;
|
|
145
|
+
/** Discovered coordinate epoch. */
|
|
146
|
+
coordinateEpoch?: number;
|
|
147
|
+
/** Discovered height interpretation. */
|
|
148
|
+
heightReference?: TilesetHeightReference;
|
|
149
|
+
/** Format-specific elevation placement rule. */
|
|
150
|
+
elevationMode?: TilesetElevationMode;
|
|
151
|
+
/** Format-specific elevation offset before unit normalization. */
|
|
152
|
+
elevationOffset?: number;
|
|
153
|
+
/** Unit of the format-specific elevation offset. */
|
|
154
|
+
elevationUnit?: string;
|
|
155
|
+
/** Number of meters represented by one elevation-offset unit. */
|
|
156
|
+
elevationUnitScale?: number;
|
|
157
|
+
/** Discovered broad coordinate frame. */
|
|
158
|
+
coordinateFrame?: TilesetCoordinateFrame;
|
|
159
|
+
/** Format wire-axis order. */
|
|
160
|
+
axisOrder?: 'xy' | 'yx' | 'xyz' | 'unknown';
|
|
161
|
+
/** Metadata provenance. */
|
|
162
|
+
provenance?: TilesetSpatialReferenceProvenance;
|
|
163
|
+
/** Non-fatal discovery qualifications. */
|
|
164
|
+
warnings?: readonly string[];
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Combines format discovery with the intentionally small application option surface.
|
|
168
|
+
*
|
|
169
|
+
* @param discovered - Values derived from dataset metadata and format defaults.
|
|
170
|
+
* @param options - Application target options and expert recovery overrides.
|
|
171
|
+
* @returns Normalized immutable spatial metadata.
|
|
172
|
+
*/
|
|
173
|
+
export declare function createTilesetSpatialReference(discovered: CreateTilesetSpatialReferenceOptions, options?: TilesetSpatialOptions): TilesetSpatialReference;
|
|
174
|
+
/**
|
|
175
|
+
* Applies application target and recovery options to format-discovered spatial metadata.
|
|
176
|
+
*
|
|
177
|
+
* @param discovered - Readonly metadata returned by a format adapter.
|
|
178
|
+
* @param options - Application target options and expert recovery overrides.
|
|
179
|
+
* @returns A new normalized immutable descriptor.
|
|
180
|
+
*/
|
|
181
|
+
export declare function applyTilesetSpatialOptions(discovered: TilesetSpatialReference | undefined, options?: TilesetSpatialOptions): TilesetSpatialReference;
|
|
182
|
+
/**
|
|
183
|
+
* Marks a normalized descriptor after every returned coordinate and bound has entered its target
|
|
184
|
+
* frame.
|
|
185
|
+
*
|
|
186
|
+
* @param spatialReference - Transformable spatial descriptor.
|
|
187
|
+
* @returns An immutable descriptor with `status: 'transformed'`.
|
|
188
|
+
*/
|
|
189
|
+
export declare function markTilesetSpatialReferenceTransformed(spatialReference: TilesetSpatialReference): TilesetSpatialReference;
|
|
190
|
+
//# sourceMappingURL=spatial-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-types.d.ts","sourceRoot":"","sources":["../../src/spatial/spatial-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAG1C,6DAA6D;AAC7D,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC;AAE1F,+EAA+E;AAC/E,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,aAAa,GAAG,aAAa,CAAC;AAEpF,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,GAChB,aA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AClE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,8BAA8B;IAC9B,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC;IAC5C,2BAA2B;IAC3B,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,oCAAoC,EAChD,OAAO,GAAE,qBAA0B,GAClC,uBAAuB,CA8GzB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,uBAAuB,GAAG,SAAS,EAC/C,OAAO,GAAE,qBAA0B,GAClC,uBAAuB,CA6BzB;AA4CD;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CACpD,gBAAgB,EAAE,uBAAuB,GACxC,uBAAuB,CAKzB"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { createSpatialReference, inferCRSRepresentation } from '@math.gl/crs';
|
|
5
|
+
import { getSpatialCoordinateFrame } from "./get-spatial-coordinate-frame.js";
|
|
6
|
+
/**
|
|
7
|
+
* Combines format discovery with the intentionally small application option surface.
|
|
8
|
+
*
|
|
9
|
+
* @param discovered - Values derived from dataset metadata and format defaults.
|
|
10
|
+
* @param options - Application target options and expert recovery overrides.
|
|
11
|
+
* @returns Normalized immutable spatial metadata.
|
|
12
|
+
*/
|
|
13
|
+
export function createTilesetSpatialReference(discovered, options = {}) {
|
|
14
|
+
const hasSourceCrsOverride = options.sourceCrs !== undefined;
|
|
15
|
+
const sourceCrs = options.sourceCrs || discovered.sourceCrs;
|
|
16
|
+
const outputCoordinates = options.outputCoordinates || 'auto';
|
|
17
|
+
const targetCrs = options.targetCrs || (outputCoordinates === 'ecef' ? 'EPSG:4978' : undefined);
|
|
18
|
+
const targetHeightReference = options.targetHeightReference || 'native';
|
|
19
|
+
const verticalUnitScale = discovered.verticalUnitScale ?? 1;
|
|
20
|
+
const elevationUnitScale = discovered.elevationUnitScale ?? 1;
|
|
21
|
+
const elevationOffset = discovered.elevationOffset || 0;
|
|
22
|
+
const requiresSurface = discovered.elevationMode === 'onTheGround' ||
|
|
23
|
+
discovered.elevationMode === 'relativeToGround' ||
|
|
24
|
+
discovered.elevationMode === 'relativeToScene';
|
|
25
|
+
const hasElevationProvider = discovered.elevationMode === 'relativeToScene'
|
|
26
|
+
? Boolean(options.sceneElevationProvider)
|
|
27
|
+
: !requiresSurface || Boolean(options.terrainElevationProvider);
|
|
28
|
+
const hasFormatVerticalOperation = verticalUnitScale !== 1 ||
|
|
29
|
+
elevationUnitScale !== 1 ||
|
|
30
|
+
(discovered.elevationMode !== undefined &&
|
|
31
|
+
(requiresSurface ||
|
|
32
|
+
(discovered.elevationMode === 'absoluteHeight' && elevationOffset !== 0)));
|
|
33
|
+
const needsHeightTransform = targetHeightReference !== 'native' && targetHeightReference !== discovered.heightReference;
|
|
34
|
+
const hasRequestedTransform = Boolean(targetCrs) ||
|
|
35
|
+
targetHeightReference !== 'native' ||
|
|
36
|
+
outputCoordinates !== 'auto' ||
|
|
37
|
+
hasFormatVerticalOperation;
|
|
38
|
+
const hasRequiredTarget = outputCoordinates !== 'target-crs' || Boolean(targetCrs);
|
|
39
|
+
const hasHeightMetadata = !needsHeightTransform || (discovered.heightReference || 'unknown') !== 'unknown';
|
|
40
|
+
const hasVerticalUnits = Number.isFinite(verticalUnitScale) &&
|
|
41
|
+
verticalUnitScale > 0 &&
|
|
42
|
+
Number.isFinite(elevationUnitScale) &&
|
|
43
|
+
elevationUnitScale > 0;
|
|
44
|
+
const canTransform = Boolean(sourceCrs) &&
|
|
45
|
+
hasRequestedTransform &&
|
|
46
|
+
hasRequiredTarget &&
|
|
47
|
+
hasHeightMetadata &&
|
|
48
|
+
hasVerticalUnits &&
|
|
49
|
+
hasElevationProvider &&
|
|
50
|
+
outputCoordinates !== 'local-enu';
|
|
51
|
+
const provenance = hasSourceCrsOverride ? 'caller-override' : discovered.provenance || 'unknown';
|
|
52
|
+
const coordinateFrame = hasSourceCrsOverride && sourceCrs
|
|
53
|
+
? getSpatialCoordinateFrame(sourceCrs)
|
|
54
|
+
: discovered.coordinateFrame;
|
|
55
|
+
const sourceCrsState = hasSourceCrsOverride
|
|
56
|
+
? 'explicit'
|
|
57
|
+
: discovered.sourceCrsState ||
|
|
58
|
+
(sourceCrs ? (provenance === 'format-default' ? 'default' : 'explicit') : 'absent');
|
|
59
|
+
const spatialReference = createSpatialReference({
|
|
60
|
+
crs: sourceCrs
|
|
61
|
+
? {
|
|
62
|
+
state: sourceCrsState === 'default' ? 'default' : 'explicit',
|
|
63
|
+
definition: sourceCrs,
|
|
64
|
+
representation: (!hasSourceCrsOverride && discovered.sourceCrsRepresentation) ||
|
|
65
|
+
inferCRSRepresentation(sourceCrs),
|
|
66
|
+
provenance,
|
|
67
|
+
alternatives: hasSourceCrsOverride ? undefined : discovered.sourceCrsAlternatives
|
|
68
|
+
}
|
|
69
|
+
: {
|
|
70
|
+
state: sourceCrsState === 'unknown' ? 'unknown' : 'absent',
|
|
71
|
+
provenance
|
|
72
|
+
},
|
|
73
|
+
vertical: discovered.verticalCrs
|
|
74
|
+
? {
|
|
75
|
+
state: 'explicit',
|
|
76
|
+
definition: discovered.verticalCrs,
|
|
77
|
+
representation: inferCRSRepresentation(discovered.verticalCrs),
|
|
78
|
+
provenance: discovered.provenance || 'metadata'
|
|
79
|
+
}
|
|
80
|
+
: undefined,
|
|
81
|
+
coordinateEpoch: options.coordinateEpoch ?? discovered.coordinateEpoch,
|
|
82
|
+
coordinateFrame,
|
|
83
|
+
coordinateOrder: getCoordinateOrder(discovered.axisOrder),
|
|
84
|
+
units: hasSourceCrsOverride ? undefined : discovered.units
|
|
85
|
+
});
|
|
86
|
+
const normalizedSourceCrs = getKnownCRSDefinition(spatialReference.crs);
|
|
87
|
+
const normalizedVerticalCrs = spatialReference.vertical
|
|
88
|
+
? getKnownCRSDefinition(spatialReference.vertical)
|
|
89
|
+
: undefined;
|
|
90
|
+
const normalizedTargetCrs = targetCrs ? cloneReadonlyCRSDefinition(targetCrs) : undefined;
|
|
91
|
+
return Object.freeze({
|
|
92
|
+
...spatialReference,
|
|
93
|
+
sourceCrs: normalizedSourceCrs,
|
|
94
|
+
verticalCrs: normalizedVerticalCrs,
|
|
95
|
+
verticalUnitScale,
|
|
96
|
+
coordinateEpoch: options.coordinateEpoch ?? discovered.coordinateEpoch,
|
|
97
|
+
heightReference: discovered.heightReference || 'unknown',
|
|
98
|
+
elevationMode: discovered.elevationMode,
|
|
99
|
+
elevationOffset: discovered.elevationOffset,
|
|
100
|
+
elevationUnit: discovered.elevationUnit,
|
|
101
|
+
elevationUnitScale,
|
|
102
|
+
coordinateFrame: coordinateFrame || 'unknown',
|
|
103
|
+
axisOrder: discovered.axisOrder || 'unknown',
|
|
104
|
+
provenance,
|
|
105
|
+
targetCrs: normalizedTargetCrs,
|
|
106
|
+
targetHeightReference,
|
|
107
|
+
outputCoordinates,
|
|
108
|
+
status: hasRequestedTransform ? (canTransform ? 'transformable' : 'unresolved') : 'native',
|
|
109
|
+
warnings: Object.freeze([...(discovered.warnings || [])])
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Applies application target and recovery options to format-discovered spatial metadata.
|
|
114
|
+
*
|
|
115
|
+
* @param discovered - Readonly metadata returned by a format adapter.
|
|
116
|
+
* @param options - Application target options and expert recovery overrides.
|
|
117
|
+
* @returns A new normalized immutable descriptor.
|
|
118
|
+
*/
|
|
119
|
+
export function applyTilesetSpatialOptions(discovered, options = {}) {
|
|
120
|
+
return createTilesetSpatialReference({
|
|
121
|
+
sourceCrs: discovered?.sourceCrs,
|
|
122
|
+
sourceCrsState: discovered?.crs.state,
|
|
123
|
+
sourceCrsRepresentation: discovered?.crs.state === 'explicit' || discovered?.crs.state === 'default'
|
|
124
|
+
? discovered.crs.representation
|
|
125
|
+
: undefined,
|
|
126
|
+
sourceCrsAlternatives: discovered?.crs.state === 'explicit' || discovered?.crs.state === 'default'
|
|
127
|
+
? discovered.crs.alternatives
|
|
128
|
+
: undefined,
|
|
129
|
+
verticalCrs: discovered?.verticalCrs,
|
|
130
|
+
units: discovered?.units,
|
|
131
|
+
verticalUnitScale: discovered?.verticalUnitScale,
|
|
132
|
+
coordinateEpoch: discovered?.coordinateEpoch,
|
|
133
|
+
heightReference: discovered?.heightReference,
|
|
134
|
+
elevationMode: discovered?.elevationMode,
|
|
135
|
+
elevationOffset: discovered?.elevationOffset,
|
|
136
|
+
elevationUnit: discovered?.elevationUnit,
|
|
137
|
+
elevationUnitScale: discovered?.elevationUnitScale,
|
|
138
|
+
coordinateFrame: discovered?.coordinateFrame,
|
|
139
|
+
axisOrder: discovered?.axisOrder,
|
|
140
|
+
provenance: discovered?.provenance,
|
|
141
|
+
warnings: discovered?.warnings
|
|
142
|
+
}, options);
|
|
143
|
+
}
|
|
144
|
+
/** Return a known definition from a canonical CRS reference. */
|
|
145
|
+
function getKnownCRSDefinition(reference) {
|
|
146
|
+
return reference.state === 'explicit' || reference.state === 'default'
|
|
147
|
+
? reference.definition
|
|
148
|
+
: undefined;
|
|
149
|
+
}
|
|
150
|
+
/** Clone and deeply freeze a target CRS through the canonical math.gl constructor. */
|
|
151
|
+
function cloneReadonlyCRSDefinition(definition) {
|
|
152
|
+
const spatialReference = createSpatialReference({
|
|
153
|
+
crs: {
|
|
154
|
+
state: 'explicit',
|
|
155
|
+
definition,
|
|
156
|
+
representation: inferCRSRepresentation(definition),
|
|
157
|
+
provenance: 'caller-override'
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const clonedDefinition = getKnownCRSDefinition(spatialReference.crs);
|
|
161
|
+
if (!clonedDefinition) {
|
|
162
|
+
throw new Error('Failed to normalize a known target CRS definition');
|
|
163
|
+
}
|
|
164
|
+
return clonedDefinition;
|
|
165
|
+
}
|
|
166
|
+
/** Convert the legacy tileset axis label to the common stored-coordinate order. */
|
|
167
|
+
function getCoordinateOrder(axisOrder) {
|
|
168
|
+
switch (axisOrder) {
|
|
169
|
+
case 'xy':
|
|
170
|
+
return ['x', 'y'];
|
|
171
|
+
case 'yx':
|
|
172
|
+
return ['y', 'x'];
|
|
173
|
+
case 'xyz':
|
|
174
|
+
return ['x', 'y', 'z'];
|
|
175
|
+
default:
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Marks a normalized descriptor after every returned coordinate and bound has entered its target
|
|
181
|
+
* frame.
|
|
182
|
+
*
|
|
183
|
+
* @param spatialReference - Transformable spatial descriptor.
|
|
184
|
+
* @returns An immutable descriptor with `status: 'transformed'`.
|
|
185
|
+
*/
|
|
186
|
+
export function markTilesetSpatialReferenceTransformed(spatialReference) {
|
|
187
|
+
if (spatialReference.status !== 'transformable' && spatialReference.status !== 'transformed') {
|
|
188
|
+
throw new Error('Only a transformable spatial reference can be marked as transformed');
|
|
189
|
+
}
|
|
190
|
+
return Object.freeze({ ...spatialReference, status: 'transformed' });
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=spatial-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-types.js","sourceRoot":"","sources":["../../src/spatial/spatial-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EAQvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,yBAAyB,EAAC,0CAAuC;AA0L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AC,GAAG,CAAC,CAAC;IACrE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,mFAAmF;AACnF,SAAS,kBAAkB,CACzB,SAA4D;IAE5D,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,KAAK,IAAI;YACP,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,KAAK,KAAK;YACR,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACzB;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACpD,gBAAyC;IAEzC,IAAI,gBAAgB,CAAC,MAAM,KAAK,eAAe,IAAI,gBAAgB,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7F,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAC,GAAG,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import { Matrix4 } from '@math.gl/core';
|
|
2
|
+
import { CullingVolume } from '@math.gl/culling';
|
|
3
|
+
import type { CullingResult } from '@math.gl/culling';
|
|
2
4
|
import type { Tileset3D } from "./tileset-3d.js";
|
|
3
5
|
import type { DoublyLinkedListNode } from "../../utils/doubly-linked-list-node.js";
|
|
4
6
|
import { TILE_REFINEMENT } from "../../constants.js";
|
|
5
|
-
import type { TileContentLoadResult } from "./tileset-source.js";
|
|
7
|
+
import type { TileChildrenLoadResult, TileContentLoadResult } from "./tileset-source.js";
|
|
6
8
|
import { FrameState } from "../helpers/frame-state.js";
|
|
7
9
|
import { CartographicBounds } from "../helpers/bounding-volume.js";
|
|
8
10
|
import { TilesetTraverser } from "./tileset-traverser.js";
|
|
11
|
+
/**
|
|
12
|
+
* Classifies render-content visibility across all content volumes owned by a tile.
|
|
13
|
+
*
|
|
14
|
+
* Content volumes form a union: one visible content entry keeps the tile renderable even when
|
|
15
|
+
* another entry is outside the frustum or clipping planes. The traversal volume is intentionally
|
|
16
|
+
* not used here except as a fallback when a tile has no content-specific volume. This separation
|
|
17
|
+
* keeps clipping render-only and prevents a tight content volume from pruning descendants.
|
|
18
|
+
*
|
|
19
|
+
* @param contentVolumes - Transformed content volumes in source order.
|
|
20
|
+
* @param fallbackVolume - Tile volume used when content does not declare its own volume.
|
|
21
|
+
* @param cullingVolume - Current view frustum.
|
|
22
|
+
* @param visibilityPlaneMask - Parent visibility mask optimization.
|
|
23
|
+
* @param clippingPlanes - Optional world-space planes applied to render content only.
|
|
24
|
+
* @returns Union visibility classification for the renderable content.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getContentVisibility(contentVolumes: any[], fallbackVolume: any, cullingVolume: CullingVolume, visibilityPlaneMask: number | undefined, clippingPlanes?: any[]): CullingResult;
|
|
9
27
|
/**
|
|
10
28
|
* @param tileset - Tileset3D instance
|
|
11
29
|
* @param header - tile header - JSON loaded from a dataset
|
|
@@ -19,6 +37,8 @@ export type Tile3DProps = {
|
|
|
19
37
|
parentHeader: Tile3D;
|
|
20
38
|
extendedId: string;
|
|
21
39
|
};
|
|
40
|
+
/** Lifecycle of a source-managed lazy child-header group. */
|
|
41
|
+
export type TileChildrenState = 'unloaded' | 'loading' | 'ready' | 'failed';
|
|
22
42
|
/**
|
|
23
43
|
* A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
|
|
24
44
|
* the content is loaded on-demand when needed based on the view.
|
|
@@ -33,6 +53,8 @@ export declare class Tile3D {
|
|
|
33
53
|
refine: TILE_REFINEMENT;
|
|
34
54
|
type: string;
|
|
35
55
|
contentUrl: string;
|
|
56
|
+
/** Resolved render-content URLs in source order; empty for contentless tiles. */
|
|
57
|
+
contentUrls: string[];
|
|
36
58
|
/** Different refinement algorithms used by I3S and 3D tiles */
|
|
37
59
|
lodMetricType: string;
|
|
38
60
|
/**
|
|
@@ -52,10 +74,23 @@ export declare class Tile3D {
|
|
|
52
74
|
* not the content's metadata in the tileset JSON file.
|
|
53
75
|
*/
|
|
54
76
|
content: any;
|
|
77
|
+
/** Loaded payloads in the same order as {@link contentUrls}; `content` remains the primary payload. */
|
|
78
|
+
contents: any[];
|
|
79
|
+
/**
|
|
80
|
+
* Metadata entity attached to this tile in the source tileset, if present.
|
|
81
|
+
*
|
|
82
|
+
* This is the raw 3D Tiles metadata reference. The generic tiles runtime preserves it without
|
|
83
|
+
* decoding schema classes or binary property tables.
|
|
84
|
+
*/
|
|
85
|
+
metadata: Record<string, any> | null;
|
|
86
|
+
/** Raw metadata entities attached to tile contents, in content source order. */
|
|
87
|
+
contentMetadata: Array<Record<string, any> | null>;
|
|
55
88
|
contentState: number;
|
|
56
89
|
gpuMemoryUsageInBytes: number;
|
|
57
90
|
/** The tile's children - an array of Tile3D objects. */
|
|
58
91
|
children: Tile3D[];
|
|
92
|
+
/** Current lifecycle state for a lazy implicit subtree rooted at this tile. */
|
|
93
|
+
childrenState: TileChildrenState;
|
|
59
94
|
depth: number;
|
|
60
95
|
viewportIds: any[];
|
|
61
96
|
transform: Matrix4;
|
|
@@ -73,14 +108,33 @@ export declare class Tile3D {
|
|
|
73
108
|
private _frameNumber;
|
|
74
109
|
private _expireDate;
|
|
75
110
|
private _expiredContent;
|
|
111
|
+
/** In-flight source request shared by repeated traversal frames. */
|
|
112
|
+
private _childrenPromise;
|
|
76
113
|
private _boundingBox?;
|
|
77
114
|
/** updated every frame for tree traversal and rendering optimizations: */
|
|
78
115
|
_distanceToCamera: number;
|
|
79
116
|
_screenSpaceError: number;
|
|
117
|
+
/** SSE calculated at the reduced viewport height used to prioritize coarse coverage. */
|
|
118
|
+
_screenSpaceErrorProgressiveResolution: number;
|
|
119
|
+
/** Whether this tile should be promoted into the progressive-resolution request pass. */
|
|
120
|
+
_priorityProgressiveResolution: boolean;
|
|
121
|
+
/** Angular distance from the camera view axis used to prioritize center tiles. */
|
|
122
|
+
_foveatedFactor: number;
|
|
123
|
+
/** Whether this peripheral request is currently inside the camera-motion deferral window. */
|
|
124
|
+
priorityDeferred: boolean;
|
|
80
125
|
private _visibilityPlaneMask;
|
|
81
126
|
private _visible;
|
|
82
127
|
private _contentBoundingVolume;
|
|
128
|
+
private _contentBoundingVolumes;
|
|
129
|
+
/** Source content-volume headers retained after render content is unloaded. */
|
|
130
|
+
private _contentBoundingVolumeHeaders;
|
|
83
131
|
private _viewerRequestVolume;
|
|
132
|
+
/** Bounding volume used to cull the tile's first renderable content entry. */
|
|
133
|
+
get contentBoundingVolume(): any;
|
|
134
|
+
/** All transformed render-content bounding volumes, including tile-volume fallbacks. */
|
|
135
|
+
get contentBoundingVolumes(): any[];
|
|
136
|
+
/** Bounding volume that limits when this tile may be requested, when declared. */
|
|
137
|
+
get viewerRequestVolume(): any;
|
|
84
138
|
_initialTransform: Matrix4;
|
|
85
139
|
_priority: number;
|
|
86
140
|
_selectedFrame: number;
|
|
@@ -121,6 +175,10 @@ export declare class Tile3D {
|
|
|
121
175
|
get hasRenderContent(): boolean;
|
|
122
176
|
/** Returns true if tile has children */
|
|
123
177
|
get hasChildren(): any;
|
|
178
|
+
/** Returns whether traversal may request an unresolved lazy child-header group. */
|
|
179
|
+
get hasUnloadedChildren(): boolean;
|
|
180
|
+
/** Returns whether a lazy child-header request is currently in flight. */
|
|
181
|
+
get childrenLoading(): boolean;
|
|
124
182
|
/**
|
|
125
183
|
* Determines if the tile's content is ready. This is automatically `true` for
|
|
126
184
|
* tiles with empty content.
|
|
@@ -157,8 +215,18 @@ export declare class Tile3D {
|
|
|
157
215
|
* @returns [min, max] each in [longitude, latitude, altitude]
|
|
158
216
|
*/
|
|
159
217
|
get boundingBox(): CartographicBounds;
|
|
160
|
-
/**
|
|
161
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Gets the tile's screen-space error for normal refinement or a reduced-height priority pass.
|
|
220
|
+
*
|
|
221
|
+
* I3S already supplies a screen-oriented LOD metric and intentionally ignores the optional 3D
|
|
222
|
+
* Tiles progressive-resolution height fraction.
|
|
223
|
+
*
|
|
224
|
+
* @param frameState - Current camera and viewport measurements.
|
|
225
|
+
* @param useParentLodMetric - Whether to substitute the parent LOD metric.
|
|
226
|
+
* @param viewportHeightFraction - Fraction of viewport height represented by the priority pass.
|
|
227
|
+
* @returns Screen-space LOD error for the current tileset format.
|
|
228
|
+
*/
|
|
229
|
+
getScreenSpaceError(frameState: any, useParentLodMetric: any, viewportHeightFraction?: number): number;
|
|
162
230
|
/**
|
|
163
231
|
* Make tile unselected than means it won't be shown
|
|
164
232
|
* but it can be still loaded in memory
|
|
@@ -168,12 +236,62 @@ export declare class Tile3D {
|
|
|
168
236
|
* Memory usage of tile on GPU
|
|
169
237
|
*/
|
|
170
238
|
_getGpuMemoryUsageInBytes(): number;
|
|
239
|
+
/**
|
|
240
|
+
* Returns scheduler priority for render-content requests.
|
|
241
|
+
*
|
|
242
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
243
|
+
*/
|
|
171
244
|
_getPriority(): number;
|
|
245
|
+
/**
|
|
246
|
+
* Returns scheduler priority for lazy child-header requests.
|
|
247
|
+
*
|
|
248
|
+
* Contentless implicit placeholders intentionally retain `UNLOADED` content state, so metadata
|
|
249
|
+
* scheduling skips only that render-content cancellation check and preserves every visibility,
|
|
250
|
+
* recency, progressive, foveated, and motion-deferral rule.
|
|
251
|
+
*
|
|
252
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
253
|
+
*/
|
|
254
|
+
private _getChildrenPriority;
|
|
255
|
+
/**
|
|
256
|
+
* Calculates the common scheduler priority for content or hierarchy metadata.
|
|
257
|
+
*
|
|
258
|
+
* @param allowUnloadedContent - Whether an empty placeholder may request child metadata.
|
|
259
|
+
* @returns Numeric priority, or a negative value when the queued request should be cancelled.
|
|
260
|
+
*/
|
|
261
|
+
private _calculateRequestPriority;
|
|
172
262
|
/**
|
|
173
263
|
* Requests the tile's content.
|
|
174
264
|
* The request may not be made if the Request Scheduler can't prioritize it.
|
|
175
265
|
*/
|
|
176
266
|
loadContent(): Promise<TileContentLoadResult>;
|
|
267
|
+
/**
|
|
268
|
+
* Requests and installs this tile's lazy child-header group through its source.
|
|
269
|
+
*
|
|
270
|
+
* The same request scheduler and SSE/foveated priority value used for render content are reused
|
|
271
|
+
* for subtree metadata. Repeated traversal frames share one promise, and scheduler cancellation
|
|
272
|
+
* restores the unloaded state so a later frame can retry.
|
|
273
|
+
*
|
|
274
|
+
* @param frameState - View state that made the subtree eligible for refinement.
|
|
275
|
+
* @returns Source load result, or an unloaded result if scheduling was cancelled.
|
|
276
|
+
*/
|
|
277
|
+
loadChildren(frameState: FrameState): Promise<TileChildrenLoadResult>;
|
|
278
|
+
/**
|
|
279
|
+
* Runs one lazy child-header load after obtaining a scheduler token.
|
|
280
|
+
*
|
|
281
|
+
* @param frameState - View state forwarded to the source implementation.
|
|
282
|
+
* @returns Source load result.
|
|
283
|
+
*/
|
|
284
|
+
private _loadChildrenWithScheduler;
|
|
285
|
+
/**
|
|
286
|
+
* Replaces a contentless implicit placeholder with its materialized subtree-root header.
|
|
287
|
+
*
|
|
288
|
+
* Transform state is intentionally preserved: the placeholder already owns the composed
|
|
289
|
+
* transform, and reapplying the root transform here would double-transform bounds and geometric
|
|
290
|
+
* error. Content and raw geometric error are reinitialized from the newly available header.
|
|
291
|
+
*
|
|
292
|
+
* @param materializedHeader - Available root header produced from one subtree resource.
|
|
293
|
+
*/
|
|
294
|
+
applyImplicitSubtreeHeader(materializedHeader: Record<string, any>): void;
|
|
177
295
|
unloadContent(): boolean;
|
|
178
296
|
/**
|
|
179
297
|
* Update the tile's visibility
|
|
@@ -182,8 +300,26 @@ export declare class Tile3D {
|
|
|
182
300
|
* @return {void}
|
|
183
301
|
*/
|
|
184
302
|
updateVisibility(frameState: any, viewportIds: any): void;
|
|
303
|
+
/**
|
|
304
|
+
* Updates progressive-resolution and foveated request metrics for a 3D Tiles traversal frame.
|
|
305
|
+
*
|
|
306
|
+
* I3S retains its format-specific screen-threshold ordering and is explicitly isolated from
|
|
307
|
+
* geometric-error scheduling. Orthographic viewports still receive progressive coverage, but
|
|
308
|
+
* angular foveation is disabled because an orthographic frustum has no perspective field of view.
|
|
309
|
+
*
|
|
310
|
+
* @param frameState - Current camera and viewport measurements.
|
|
311
|
+
*/
|
|
312
|
+
_updateRequestPriorityMetrics(frameState: FrameState): void;
|
|
185
313
|
visibility(frameState: any, parentVisibilityPlaneMask: any): any;
|
|
186
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Determines whether renderable content intersects the view and configured clipping planes.
|
|
316
|
+
*
|
|
317
|
+
* Clipping planes are render-only constraints; traversal continues to use the tile volume.
|
|
318
|
+
*
|
|
319
|
+
* @param frameState Current camera, culling, and optional clipping-plane state.
|
|
320
|
+
* @returns The content visibility classification.
|
|
321
|
+
*/
|
|
322
|
+
contentVisibility(frameState: FrameState): CullingResult;
|
|
187
323
|
/**
|
|
188
324
|
* Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
|
|
189
325
|
* @param frameState The frame state.
|
|
@@ -227,6 +363,13 @@ export declare class Tile3D {
|
|
|
227
363
|
_initializeContent(tileHeader: any): void;
|
|
228
364
|
_initializeRenderingState(header: any): void;
|
|
229
365
|
_getRefine(refine: any): any;
|
|
366
|
+
/**
|
|
367
|
+
* Returns whether loaded content is an external tileset.
|
|
368
|
+
*
|
|
369
|
+
* Parsed shape is authoritative because valid external resources may be extensionless, signed,
|
|
370
|
+
* or use a misleading filename. This method is called only after source loading has populated
|
|
371
|
+
* `content`.
|
|
372
|
+
*/
|
|
230
373
|
_isTileset(): boolean;
|
|
231
374
|
_onContentLoaded(): void;
|
|
232
375
|
_updateBoundingVolume(header: any): void;
|