@loaders.gl/tiles 4.4.5 → 5.0.0-alpha.2

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.
Files changed (227) hide show
  1. package/LICENSE +14 -3
  2. package/README.md +110 -1
  3. package/dist/dist.dev.js +6588 -2057
  4. package/dist/dist.min.js +1 -1
  5. package/dist/image-set.d.ts +94 -0
  6. package/dist/image-set.d.ts.map +1 -0
  7. package/dist/image-set.js +243 -0
  8. package/dist/image-set.js.map +1 -0
  9. package/dist/index.cjs +6872 -2160
  10. package/dist/index.cjs.map +3 -4
  11. package/dist/index.d.ts +33 -9
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +18 -8
  14. package/dist/index.js.map +1 -1
  15. package/dist/point-cloud/point-cloud-tile.d.ts +47 -0
  16. package/dist/point-cloud/point-cloud-tile.d.ts.map +1 -0
  17. package/dist/point-cloud/point-cloud-tile.js +70 -0
  18. package/dist/point-cloud/point-cloud-tile.js.map +1 -0
  19. package/dist/point-cloud/point-cloud-tileset.d.ts +131 -0
  20. package/dist/point-cloud/point-cloud-tileset.d.ts.map +1 -0
  21. package/dist/point-cloud/point-cloud-tileset.js +510 -0
  22. package/dist/point-cloud/point-cloud-tileset.js.map +1 -0
  23. package/dist/point-cloud/types.d.ts +64 -0
  24. package/dist/point-cloud/types.d.ts.map +1 -0
  25. package/dist/point-cloud/types.js +5 -0
  26. package/dist/point-cloud/types.js.map +1 -0
  27. package/dist/raster-set.d.ts +113 -0
  28. package/dist/raster-set.d.ts.map +1 -0
  29. package/dist/raster-set.js +274 -0
  30. package/dist/raster-set.js.map +1 -0
  31. package/dist/tileset-2d/adapter.d.ts +38 -0
  32. package/dist/tileset-2d/adapter.d.ts.map +1 -0
  33. package/dist/tileset-2d/adapter.js +5 -0
  34. package/dist/tileset-2d/adapter.js.map +1 -0
  35. package/dist/tileset-2d/index.d.ts +7 -0
  36. package/dist/tileset-2d/index.d.ts.map +1 -0
  37. package/dist/tileset-2d/index.js +6 -0
  38. package/dist/tileset-2d/index.js.map +1 -0
  39. package/dist/tileset-2d/tile-2d-header.d.ts +68 -0
  40. package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -0
  41. package/dist/tileset-2d/tile-2d-header.js +181 -0
  42. package/dist/tileset-2d/tile-2d-header.js.map +1 -0
  43. package/dist/tileset-2d/tileset-2d.d.ts +201 -0
  44. package/dist/tileset-2d/tileset-2d.d.ts.map +1 -0
  45. package/dist/tileset-2d/tileset-2d.js +532 -0
  46. package/dist/tileset-2d/tileset-2d.js.map +1 -0
  47. package/dist/tileset-2d/types.d.ts +44 -0
  48. package/dist/tileset-2d/types.d.ts.map +1 -0
  49. package/dist/tileset-2d/types.js +5 -0
  50. package/dist/tileset-2d/types.js.map +1 -0
  51. package/dist/tileset-2d.d.ts +2 -0
  52. package/dist/tileset-2d.d.ts.map +1 -0
  53. package/dist/tileset-2d.js +5 -0
  54. package/dist/tileset-2d.js.map +1 -0
  55. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +60 -0
  56. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +1 -0
  57. package/dist/tileset-3d/common/indexed-archive-tileset-source.js +125 -0
  58. package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +1 -0
  59. package/dist/{tileset → tileset-3d/common}/tile-3d.d.ts +133 -29
  60. package/dist/tileset-3d/common/tile-3d.d.ts.map +1 -0
  61. package/dist/{tileset → tileset-3d/common}/tile-3d.js +282 -77
  62. package/dist/tileset-3d/common/tile-3d.js.map +1 -0
  63. package/dist/tileset-3d/common/tileset-3d.d.ts +317 -0
  64. package/dist/tileset-3d/common/tileset-3d.d.ts.map +1 -0
  65. package/dist/tileset-3d/common/tileset-3d.js +807 -0
  66. package/dist/tileset-3d/common/tileset-3d.js.map +1 -0
  67. package/dist/tileset-3d/common/tileset-cache.d.ts +29 -0
  68. package/dist/tileset-3d/common/tileset-cache.d.ts.map +1 -0
  69. package/dist/{tileset → tileset-3d/common}/tileset-cache.js +12 -4
  70. package/dist/tileset-3d/common/tileset-cache.js.map +1 -0
  71. package/dist/tileset-3d/common/tileset-source.d.ts +204 -0
  72. package/dist/tileset-3d/common/tileset-source.d.ts.map +1 -0
  73. package/dist/tileset-3d/common/tileset-source.js +17 -0
  74. package/dist/tileset-3d/common/tileset-source.js.map +1 -0
  75. package/dist/{tileset → tileset-3d/common}/tileset-traverser.d.ts +15 -2
  76. package/dist/tileset-3d/common/tileset-traverser.d.ts.map +1 -0
  77. package/dist/{tileset → tileset-3d/common}/tileset-traverser.js +30 -3
  78. package/dist/tileset-3d/common/tileset-traverser.js.map +1 -0
  79. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +111 -0
  80. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +1 -0
  81. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +340 -0
  82. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +1 -0
  83. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +189 -0
  84. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +1 -0
  85. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +510 -0
  86. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +1 -0
  87. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +43 -0
  88. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +1 -0
  89. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +119 -0
  90. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +1 -0
  91. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +1 -0
  92. package/dist/{tileset → tileset-3d}/format-i3s/i3s-pending-tiles-register.js +3 -0
  93. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +1 -0
  94. package/dist/tileset-3d/format-i3s/i3s-source.d.ts +99 -0
  95. package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +1 -0
  96. package/dist/tileset-3d/format-i3s/i3s-source.js +299 -0
  97. package/dist/tileset-3d/format-i3s/i3s-source.js.map +1 -0
  98. package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +1 -0
  99. package/dist/{tileset → tileset-3d}/format-i3s/i3s-tile-manager.js +5 -2
  100. package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +1 -0
  101. package/dist/{tileset → tileset-3d}/format-i3s/i3s-tileset-traverser.d.ts +2 -2
  102. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +1 -0
  103. package/dist/{tileset → tileset-3d}/format-i3s/i3s-tileset-traverser.js +17 -23
  104. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +1 -0
  105. package/dist/{tileset → tileset-3d}/helpers/3d-tiles-options.d.ts +1 -1
  106. package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +1 -0
  107. package/dist/{tileset → tileset-3d}/helpers/3d-tiles-options.js +3 -0
  108. package/dist/tileset-3d/helpers/3d-tiles-options.js.map +1 -0
  109. package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +1 -0
  110. package/dist/{tileset → tileset-3d}/helpers/bounding-volume.js +1 -0
  111. package/dist/tileset-3d/helpers/bounding-volume.js.map +1 -0
  112. package/dist/tileset-3d/helpers/frame-state.d.ts +86 -0
  113. package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -0
  114. package/dist/{tileset → tileset-3d}/helpers/frame-state.js +84 -9
  115. package/dist/tileset-3d/helpers/frame-state.js.map +1 -0
  116. package/dist/{tileset → tileset-3d}/helpers/i3s-lod.d.ts +1 -1
  117. package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +1 -0
  118. package/dist/{tileset → tileset-3d}/helpers/i3s-lod.js +1 -1
  119. package/dist/tileset-3d/helpers/i3s-lod.js.map +1 -0
  120. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +72 -0
  121. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +1 -0
  122. package/dist/tileset-3d/helpers/tiles-3d-lod.js +257 -0
  123. package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +1 -0
  124. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +134 -0
  125. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +1 -0
  126. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +179 -0
  127. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +1 -0
  128. package/dist/{tileset → tileset-3d}/helpers/transform-utils.d.ts +1 -1
  129. package/dist/tileset-3d/helpers/transform-utils.d.ts.map +1 -0
  130. package/dist/tileset-3d/helpers/transform-utils.js.map +1 -0
  131. package/dist/tileset-3d/helpers/zoom.d.ts.map +1 -0
  132. package/dist/tileset-3d/helpers/zoom.js.map +1 -0
  133. package/dist/types.d.ts +9 -0
  134. package/dist/types.d.ts.map +1 -1
  135. package/dist/types.js +3 -0
  136. package/dist/types.js.map +1 -1
  137. package/dist/utils/doubly-linked-list.d.ts.map +1 -1
  138. package/dist/utils/doubly-linked-list.js +1 -0
  139. package/dist/utils/doubly-linked-list.js.map +1 -1
  140. package/dist/utils/managed-array.d.ts.map +1 -1
  141. package/dist/utils/managed-array.js +1 -0
  142. package/dist/utils/managed-array.js.map +1 -1
  143. package/package.json +7 -6
  144. package/src/image-set.ts +328 -0
  145. package/src/index.ts +99 -9
  146. package/src/point-cloud/point-cloud-tile.ts +80 -0
  147. package/src/point-cloud/point-cloud-tileset.ts +713 -0
  148. package/src/point-cloud/types.ts +82 -0
  149. package/src/raster-set.ts +412 -0
  150. package/src/tileset-2d/adapter.ts +47 -0
  151. package/src/tileset-2d/index.ts +33 -0
  152. package/src/tileset-2d/tile-2d-header.ts +224 -0
  153. package/src/tileset-2d/tileset-2d.ts +716 -0
  154. package/src/tileset-2d/types.ts +39 -0
  155. package/src/tileset-2d.ts +5 -0
  156. package/src/tileset-3d/common/indexed-archive-tileset-source.ts +205 -0
  157. package/src/{tileset → tileset-3d/common}/tile-3d.ts +348 -93
  158. package/src/tileset-3d/common/tileset-3d.ts +1087 -0
  159. package/src/{tileset → tileset-3d/common}/tileset-cache.ts +16 -8
  160. package/src/tileset-3d/common/tileset-source.ts +255 -0
  161. package/src/{tileset → tileset-3d/common}/tileset-traverser.ts +32 -4
  162. package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +534 -0
  163. package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +632 -0
  164. package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +140 -0
  165. package/src/{tileset → tileset-3d}/format-i3s/i3s-pending-tiles-register.ts +4 -0
  166. package/src/tileset-3d/format-i3s/i3s-source.ts +366 -0
  167. package/src/{tileset → tileset-3d}/format-i3s/i3s-tile-manager.ts +6 -2
  168. package/src/{tileset → tileset-3d}/format-i3s/i3s-tileset-traverser.ts +19 -24
  169. package/src/{tileset → tileset-3d}/helpers/3d-tiles-options.ts +5 -1
  170. package/src/{tileset → tileset-3d}/helpers/bounding-volume.ts +2 -0
  171. package/src/tileset-3d/helpers/frame-state.ts +311 -0
  172. package/src/{tileset → tileset-3d}/helpers/i3s-lod.ts +2 -2
  173. package/src/tileset-3d/helpers/tiles-3d-lod.ts +370 -0
  174. package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +301 -0
  175. package/src/{tileset → tileset-3d}/helpers/transform-utils.ts +1 -1
  176. package/src/types.ts +13 -0
  177. package/src/utils/doubly-linked-list.ts +2 -0
  178. package/src/utils/managed-array.ts +2 -0
  179. package/dist/tileset/format-3d-tiles/tileset-3d-traverser.d.ts +0 -7
  180. package/dist/tileset/format-3d-tiles/tileset-3d-traverser.d.ts.map +0 -1
  181. package/dist/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -53
  182. package/dist/tileset/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
  183. package/dist/tileset/format-i3s/i3s-pending-tiles-register.d.ts.map +0 -1
  184. package/dist/tileset/format-i3s/i3s-pending-tiles-register.js.map +0 -1
  185. package/dist/tileset/format-i3s/i3s-tile-manager.d.ts.map +0 -1
  186. package/dist/tileset/format-i3s/i3s-tile-manager.js.map +0 -1
  187. package/dist/tileset/format-i3s/i3s-tileset-traverser.d.ts.map +0 -1
  188. package/dist/tileset/format-i3s/i3s-tileset-traverser.js.map +0 -1
  189. package/dist/tileset/helpers/3d-tiles-options.d.ts.map +0 -1
  190. package/dist/tileset/helpers/3d-tiles-options.js.map +0 -1
  191. package/dist/tileset/helpers/bounding-volume.d.ts.map +0 -1
  192. package/dist/tileset/helpers/bounding-volume.js.map +0 -1
  193. package/dist/tileset/helpers/frame-state.d.ts +0 -28
  194. package/dist/tileset/helpers/frame-state.d.ts.map +0 -1
  195. package/dist/tileset/helpers/frame-state.js.map +0 -1
  196. package/dist/tileset/helpers/i3s-lod.d.ts.map +0 -1
  197. package/dist/tileset/helpers/i3s-lod.js.map +0 -1
  198. package/dist/tileset/helpers/tiles-3d-lod.d.ts +0 -8
  199. package/dist/tileset/helpers/tiles-3d-lod.d.ts.map +0 -1
  200. package/dist/tileset/helpers/tiles-3d-lod.js +0 -113
  201. package/dist/tileset/helpers/tiles-3d-lod.js.map +0 -1
  202. package/dist/tileset/helpers/transform-utils.d.ts.map +0 -1
  203. package/dist/tileset/helpers/transform-utils.js.map +0 -1
  204. package/dist/tileset/helpers/zoom.d.ts.map +0 -1
  205. package/dist/tileset/helpers/zoom.js.map +0 -1
  206. package/dist/tileset/tile-3d.d.ts.map +0 -1
  207. package/dist/tileset/tile-3d.js.map +0 -1
  208. package/dist/tileset/tileset-3d.d.ts +0 -284
  209. package/dist/tileset/tileset-3d.d.ts.map +0 -1
  210. package/dist/tileset/tileset-3d.js +0 -814
  211. package/dist/tileset/tileset-3d.js.map +0 -1
  212. package/dist/tileset/tileset-cache.d.ts +0 -19
  213. package/dist/tileset/tileset-cache.d.ts.map +0 -1
  214. package/dist/tileset/tileset-cache.js.map +0 -1
  215. package/dist/tileset/tileset-traverser.d.ts.map +0 -1
  216. package/dist/tileset/tileset-traverser.js.map +0 -1
  217. package/src/tileset/format-3d-tiles/tileset-3d-traverser.ts +0 -63
  218. package/src/tileset/helpers/frame-state.ts +0 -183
  219. package/src/tileset/helpers/tiles-3d-lod.ts +0 -149
  220. package/src/tileset/tileset-3d.ts +0 -1037
  221. /package/dist/{tileset → tileset-3d}/format-i3s/i3s-pending-tiles-register.d.ts +0 -0
  222. /package/dist/{tileset → tileset-3d}/format-i3s/i3s-tile-manager.d.ts +0 -0
  223. /package/dist/{tileset → tileset-3d}/helpers/bounding-volume.d.ts +0 -0
  224. /package/dist/{tileset → tileset-3d}/helpers/transform-utils.js +0 -0
  225. /package/dist/{tileset → tileset-3d}/helpers/zoom.d.ts +0 -0
  226. /package/dist/{tileset → tileset-3d}/helpers/zoom.js +0 -0
  227. /package/src/{tileset → tileset-3d}/helpers/zoom.ts +0 -0
@@ -0,0 +1,257 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // This file is derived from the Cesium code base under Apache 2 license
5
+ // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
6
+ import { Matrix4, Quaternion, Vector3, clamp } from '@math.gl/core';
7
+ const scratchPositionNormal = new Vector3();
8
+ const scratchCartographic = new Vector3();
9
+ const scratchCenter = new Vector3();
10
+ const scratchPosition = new Vector3();
11
+ const scratchDirection = new Vector3();
12
+ const scratchBoxXAxis = new Vector3();
13
+ const scratchBoxYAxis = new Vector3();
14
+ const scratchBoxZAxis = new Vector3();
15
+ const scratchBoxQuaternion = new Quaternion();
16
+ const unitZDirection = new Vector3(0, 0, 1);
17
+ /**
18
+ * Refreshes the root transform before calculating transform-dependent dynamic SSE density.
19
+ *
20
+ * Traversal normally updates transforms while visiting tile visibility, but density is calculated
21
+ * immediately before traversal. Performing the root update at that earlier boundary keeps local
22
+ * box and sphere height falloff synchronized with an animated tileset model matrix in the same
23
+ * frame. {@link Tile3D._updateTransform} also recalculates world-space geometric error from its raw
24
+ * source value, so repeated calls do not compound scale.
25
+ *
26
+ * @param root - Root tile whose computed transform feeds dynamic SSE height calculations.
27
+ * @param modelMatrix - Current tileset-to-world transform for this frame.
28
+ */
29
+ export function updateRootTransformForDynamicScreenSpaceError(root, modelMatrix) {
30
+ root._updateTransform(modelMatrix);
31
+ }
32
+ /**
33
+ * Calculates the effective dynamic screen-space error density for one viewport and frame.
34
+ *
35
+ * Dynamic SSE is a perspective-only optimization for street-level views. It reduces refinement
36
+ * for distant tiles near the horizon, where loading every geometric detail is expensive and has
37
+ * limited visual benefit. Density fades to zero as the camera rises above the tileset or points
38
+ * vertically. The returned value belongs to the supplied frame state; callers must not reuse it
39
+ * for another viewport because camera height and direction are view dependent.
40
+ *
41
+ * @param root - Root tile whose transform and source bounding volume define the tileset space.
42
+ * @param frameState - Current camera measurements in WGS84 and logical viewport space.
43
+ * @param options - Dynamic SSE density and height-falloff controls.
44
+ * @returns Effective fog density for this viewport, or zero when it cannot be calculated.
45
+ */
46
+ export function calculateDynamicScreenSpaceErrorDensity(root, frameState, options) {
47
+ if (!Number.isFinite(options.dynamicScreenSpaceErrorDensity) ||
48
+ options.dynamicScreenSpaceErrorDensity <= 0) {
49
+ return 0;
50
+ }
51
+ const boundingVolumeHeader = getContentBoundingVolumeHeader(root);
52
+ const heightRange = boundingVolumeHeader.region
53
+ ? getRegionHeightRange(boundingVolumeHeader.region, frameState)
54
+ : getCartesianHeightRange(root, boundingVolumeHeader, frameState);
55
+ if (!heightRange) {
56
+ return 0;
57
+ }
58
+ const heightFalloff = clamp(options.dynamicScreenSpaceErrorHeightFalloff, 0, 1);
59
+ const heightClose = heightRange.minimumHeight +
60
+ (heightRange.maximumHeight - heightRange.minimumHeight) * heightFalloff;
61
+ const heightSpan = heightRange.maximumHeight - heightClose;
62
+ const heightPercentage = heightSpan > 0
63
+ ? clamp((heightRange.cameraHeight - heightClose) / heightSpan, 0, 1)
64
+ : heightRange.cameraHeight >= heightRange.maximumHeight
65
+ ? 1
66
+ : 0;
67
+ // A horizontal view has a dot product near zero and receives the strongest optimization.
68
+ // A vertical view has a dot product near one and keeps the unmodified perspective SSE.
69
+ const verticalAlignment = clamp(Math.abs(heightRange.cameraDirection.dot(heightRange.upDirection)), 0, 1);
70
+ const horizonFactor = (1 - verticalAlignment) * (1 - heightPercentage);
71
+ return options.dynamicScreenSpaceErrorDensity * horizonFactor;
72
+ }
73
+ /**
74
+ * Calculates exponential fog strength for a camera distance and density.
75
+ * @param distanceToCamera - Distance from the camera to the tile bounding volume in meters.
76
+ * @param density - Effective dynamic SSE density in inverse meters.
77
+ * @returns Unitless strength in the inclusive range from zero to one.
78
+ */
79
+ export function getDynamicScreenSpaceErrorFog(distanceToCamera, density) {
80
+ const scalar = distanceToCamera * density;
81
+ return 1 - Math.exp(-(scalar * scalar));
82
+ }
83
+ /**
84
+ * Calculates the perspective SSE reduction for a tile.
85
+ * @param distanceToCamera - Distance from the camera to the tile bounding volume in meters.
86
+ * @param density - View-dependent fog density calculated for the current frame.
87
+ * @param factor - Maximum reduction in logical/CSS pixels.
88
+ * @returns Number of logical pixels to subtract from perspective SSE.
89
+ */
90
+ export function getDynamicScreenSpaceError(distanceToCamera, density, factor) {
91
+ if (density <= 0 || factor <= 0 || !Number.isFinite(density) || !Number.isFinite(factor)) {
92
+ return 0;
93
+ }
94
+ return getDynamicScreenSpaceErrorFog(distanceToCamera, density) * factor;
95
+ }
96
+ /**
97
+ * Calculates 3D Tiles screen-space error (SSE) for the current projection.
98
+ *
99
+ * Perspective SSE projects the tile's world-space geometric error through the existing viewport
100
+ * height and frustum denominator. Dynamic SSE may then reduce distant horizon refinement using
101
+ * the density calculated specifically for this frame and viewport. Orthographic projection has
102
+ * no perspective distance falloff, so its error is divided directly by the viewport's world-space
103
+ * meters per logical pixel and is never adjusted by perspective dynamic SSE.
104
+ *
105
+ * @param tile - Tile containing the transform-scaled geometric error and camera distance.
106
+ * @param frameState - Current camera and viewport measurements.
107
+ * @param useParentLodMetric - Whether request prioritization should use the parent's error.
108
+ * @param viewportHeightFraction - Fraction of viewport height represented by the priority pass.
109
+ * @returns Estimated error in logical/CSS pixels.
110
+ */
111
+ export function getTiles3DScreenSpaceError(tile, frameState, useParentLodMetric, viewportHeightFraction = 1) {
112
+ const tileset = tile.tileset;
113
+ const parentLodMetricValue = (tile.parent && tile.parent.lodMetricValue) || tile.lodMetricValue;
114
+ const lodMetricValue = useParentLodMetric ? parentLodMetricValue : tile.lodMetricValue;
115
+ // Leaf tiles do not have any error so save the computation.
116
+ if (lodMetricValue === 0) {
117
+ return 0;
118
+ }
119
+ const { viewDistanceScale } = tileset.options;
120
+ const lodScale = viewDistanceScale || 1;
121
+ const heightFraction = Number.isFinite(viewportHeightFraction)
122
+ ? Math.max(viewportHeightFraction, 0)
123
+ : 1;
124
+ const orthographicError = getOrthographicScreenSpaceError(lodMetricValue, frameState, lodScale, heightFraction);
125
+ if (orthographicError !== null) {
126
+ return orthographicError;
127
+ }
128
+ // Avoid divide by zero when viewer is inside the tile.
129
+ const distanceToCamera = Math.max(tile._distanceToCamera, 1e-7);
130
+ const { height, sseDenominator } = frameState;
131
+ let screenSpaceError = (lodMetricValue * height * heightFraction * lodScale) / (distanceToCamera * sseDenominator);
132
+ if (tileset.options.dynamicScreenSpaceError && !frameState.viewport.orthographic) {
133
+ screenSpaceError -= getDynamicScreenSpaceError(distanceToCamera, frameState.dynamicScreenSpaceErrorDensity, tileset.options.dynamicScreenSpaceErrorFactor);
134
+ }
135
+ return screenSpaceError;
136
+ }
137
+ /**
138
+ * Calculates orthographic SSE when the viewport provides a valid logical-pixel scale.
139
+ *
140
+ * deck.gl viewport dimensions and `metersPerPixel` use logical/CSS pixels. Applying the browser's
141
+ * device pixel ratio again would therefore double-correct the result and select different LODs on
142
+ * otherwise identical displays. If a structural third-party viewport does not expose a usable
143
+ * scale, `null` tells the caller to retain the established perspective-compatible fallback.
144
+ *
145
+ * @param lodMetricValue - Transform-scaled geometric error in world-space meters.
146
+ * @param frameState - Current frame state containing the viewport.
147
+ * @param lodScale - Application refinement scale from `viewDistanceScale`.
148
+ * @param viewportHeightFraction - Fraction of logical viewport height represented by the pass.
149
+ * @returns SSE in logical pixels, or `null` when orthographic SSE cannot be calculated.
150
+ */
151
+ function getOrthographicScreenSpaceError(lodMetricValue, frameState, lodScale, viewportHeightFraction) {
152
+ const viewport = frameState.viewport;
153
+ if (!viewport?.orthographic) {
154
+ return null;
155
+ }
156
+ const metersPerPixel = viewport.metersPerPixel;
157
+ if (!Number.isFinite(metersPerPixel) || !metersPerPixel || metersPerPixel <= 0) {
158
+ return null;
159
+ }
160
+ return (lodMetricValue * lodScale * viewportHeightFraction) / metersPerPixel;
161
+ }
162
+ /** Returns the content bounding volume header, falling back to the traversal volume. */
163
+ function getContentBoundingVolumeHeader(root) {
164
+ return root.header.content?.boundingVolume || root.header.boundingVolume;
165
+ }
166
+ /** Calculates camera and tileset heights for a geodetic region bounding volume. */
167
+ function getRegionHeightRange(region, frameState) {
168
+ const upDirection = scratchPositionNormal.copy(frameState.camera.position).normalize();
169
+ const cameraDirection = scratchDirection.copy(frameState.camera.direction).normalize();
170
+ return {
171
+ cameraHeight: frameState.camera.cartographicPosition[2],
172
+ minimumHeight: region[4],
173
+ maximumHeight: region[5],
174
+ cameraDirection,
175
+ upDirection
176
+ };
177
+ }
178
+ /**
179
+ * Calculates camera and tileset heights for box and sphere volumes.
180
+ *
181
+ * The root transform is inverted so that both camera height and source volume dimensions use the
182
+ * same coordinate system. Small coordinates are treated as local z-up. Earth-scale coordinates
183
+ * are treated as WGS84 and use cartographic height, matching Cesium's conservative approximation.
184
+ */
185
+ function getCartesianHeightRange(root, boundingVolumeHeader, frameState) {
186
+ const halfHeight = getBoundingVolumeCenterAndHalfHeight(boundingVolumeHeader, scratchCenter);
187
+ if (halfHeight === null) {
188
+ return null;
189
+ }
190
+ const localTransform = new Matrix4(root.computedTransform).invert();
191
+ const ellipsoid = root.tileset.ellipsoid;
192
+ const centerMagnitude = Math.hypot(scratchCenter[0], scratchCenter[1], scratchCenter[2]);
193
+ if (centerMagnitude > ellipsoid.minimumRadius) {
194
+ const centerCartographic = ellipsoid.cartesianToCartographic(scratchCenter, scratchCartographic);
195
+ const upDirection = scratchPositionNormal.copy(frameState.camera.position).normalize();
196
+ const cameraDirection = scratchDirection.copy(frameState.camera.direction).normalize();
197
+ return {
198
+ cameraHeight: frameState.camera.cartographicPosition[2],
199
+ minimumHeight: 0,
200
+ maximumHeight: centerCartographic[2] * 2,
201
+ cameraDirection,
202
+ upDirection
203
+ };
204
+ }
205
+ localTransform.transformAsPoint(frameState.camera.position, scratchPosition);
206
+ localTransform.transformAsVector(frameState.camera.direction, scratchDirection);
207
+ scratchDirection.normalize();
208
+ return {
209
+ cameraHeight: scratchPosition[2],
210
+ minimumHeight: scratchCenter[2] - halfHeight,
211
+ maximumHeight: scratchCenter[2] + halfHeight,
212
+ cameraDirection: scratchDirection,
213
+ upDirection: unitZDirection
214
+ };
215
+ }
216
+ /**
217
+ * Copies the source volume center and returns its conservative z-up half-height.
218
+ * @param boundingVolumeHeader - Root content or traversal volume from tileset JSON.
219
+ * @param result - Scratch vector that receives the source-space center.
220
+ * @returns Half-height in source-space meters, or `null` for an unsupported volume.
221
+ */
222
+ function getBoundingVolumeCenterAndHalfHeight(boundingVolumeHeader, result) {
223
+ if (boundingVolumeHeader.box) {
224
+ const box = boundingVolumeHeader.box;
225
+ result.set(box[0], box[1], box[2]);
226
+ return getBoxHalfHeight(box);
227
+ }
228
+ if (boundingVolumeHeader.sphere) {
229
+ const sphere = boundingVolumeHeader.sphere;
230
+ result.set(sphere[0], sphere[1], sphere[2]);
231
+ return sphere[3];
232
+ }
233
+ return null;
234
+ }
235
+ /**
236
+ * Returns the conservative source-z extent of an oriented box.
237
+ *
238
+ * A 12-component 3D Tiles box stores three half-axis vectors, so every vector can contribute to
239
+ * vertical height after rotation. The alternate 10-component representation stores half sizes and
240
+ * a quaternion; rotating its three scaled basis vectors produces the same sum of absolute z
241
+ * projections. Using only the nominal z axis would underestimate tilted volumes and fade dynamic
242
+ * SSE too early while the camera is still within the tileset's height range.
243
+ *
244
+ * @param box - Source-space oriented box in half-axis or half-size/quaternion form.
245
+ * @returns Conservative source-z half-height in the box coordinate system's distance units.
246
+ */
247
+ function getBoxHalfHeight(box) {
248
+ if (box.length === 10) {
249
+ scratchBoxQuaternion.fromArray(box, 6);
250
+ scratchBoxXAxis.set(box[3], 0, 0).transformByQuaternion(scratchBoxQuaternion);
251
+ scratchBoxYAxis.set(0, box[4], 0).transformByQuaternion(scratchBoxQuaternion);
252
+ scratchBoxZAxis.set(0, 0, box[5]).transformByQuaternion(scratchBoxQuaternion);
253
+ return (Math.abs(scratchBoxXAxis[2]) + Math.abs(scratchBoxYAxis[2]) + Math.abs(scratchBoxZAxis[2]));
254
+ }
255
+ return Math.abs(box[5]) + Math.abs(box[8]) + Math.abs(box[11]);
256
+ }
257
+ //# sourceMappingURL=tiles-3d-lod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiles-3d-lod.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/tiles-3d-lod.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,wEAAwE;AACxE,4FAA4F;AAE5F,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AA6BlE,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAE,CAAC;AAC5C,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAE,CAAC;AAC1C,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC;AACpC,MAAM,eAAe,GAAG,IAAI,OAAO,EAAE,CAAC;AACtC,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC,MAAM,eAAe,GAAG,IAAI,OAAO,EAAE,CAAC;AACtC,MAAM,eAA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K,EAAE,EAAE,CAAC;QACtB,oBAAoB,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACvC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;QAC9E,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;QAC9E,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;QAC9E,OAAO,CACL,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAC3F,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,134 @@
1
+ import { BoundingSphere, OrientedBoundingBox } from '@math.gl/culling';
2
+ import { TILE_REFINEMENT } from "../../constants.js";
3
+ /**
4
+ * Interpolates the logical-pixel SSE relaxation used outside the foveated center cone.
5
+ *
6
+ * @param minimumValue - Relaxation at the edge of the center cone, in logical pixels.
7
+ * @param maximumValue - Maximum relaxation at the edge of the perspective field of view, in
8
+ * logical pixels.
9
+ * @param interpolationAmount - Normalized distance from the cone edge toward the field-of-view
10
+ * edge, clamped to `[0, 1]` by the caller.
11
+ * @returns Interpolated SSE relaxation in logical pixels. Non-finite results are treated as zero.
12
+ */
13
+ export type FoveatedInterpolationCallback = (minimumValue: number, maximumValue: number, interpolationAmount: number) => number;
14
+ /** Camera measurements required to calculate a tile's foveated priority. */
15
+ export type FoveatedPriorityCamera = {
16
+ /** Camera position in the same world-space coordinate system as the tile bounding volume. */
17
+ position: number[];
18
+ /** Normalized world-space camera direction. */
19
+ direction: number[];
20
+ };
21
+ /** Inputs that determine whether a peripheral tile request may be deferred. */
22
+ export type FoveatedDeferralParameters = {
23
+ /** Tile refinement mode. */
24
+ refinement: TILE_REFINEMENT;
25
+ /** Whether replacement traversal may skip hierarchy levels while retaining ancestors. */
26
+ skipLevelOfDetail: boolean;
27
+ /** Whether foveated prioritization is enabled. */
28
+ foveatedScreenSpaceError: boolean;
29
+ /** Fraction of the field of view that loads without foveated SSE relaxation. */
30
+ foveatedConeSize: number;
31
+ /** Minimum logical-pixel relaxation at the edge of the foveated cone. */
32
+ minimumScreenSpaceErrorRelaxation: number;
33
+ /** Interpolation function used to increase relaxation toward the viewport edge. */
34
+ interpolationCallback: FoveatedInterpolationCallback;
35
+ /** Tile distance from the camera view axis, represented as an angular factor. */
36
+ foveatedFactor: number;
37
+ /** Camera vertical field of view in radians. */
38
+ verticalFieldOfView: number;
39
+ /** Tile SSE in logical pixels. */
40
+ screenSpaceError: number;
41
+ /** Parent SSE in logical pixels, when a parent exists. */
42
+ parentScreenSpaceError?: number;
43
+ /** Current traversal SSE threshold in logical pixels. */
44
+ maximumScreenSpaceError: number;
45
+ /** Whether the tile contributes coarse progressive-resolution coverage. */
46
+ priorityProgressiveResolution: boolean;
47
+ };
48
+ /** Inputs used to encode a stable, lexicographically ordered request priority. */
49
+ export type TileRequestPriorityParameters = {
50
+ /** Whether the tile contributes coarse progressive-resolution coverage. */
51
+ priorityProgressiveResolution: boolean;
52
+ /** Tile distance from the camera view axis, represented as an angular factor. */
53
+ foveatedFactor: number;
54
+ /** Existing reverse-SSE ordering value; smaller values are more urgent. */
55
+ reverseScreenSpaceError: number;
56
+ /** Root SSE used to normalize reverse-SSE ordering without changing its order. */
57
+ rootScreenSpaceError: number;
58
+ };
59
+ /**
60
+ * Linearly interpolates between two values.
61
+ *
62
+ * @param minimumValue - Value returned when `interpolationAmount` is zero.
63
+ * @param maximumValue - Value returned when `interpolationAmount` is one.
64
+ * @param interpolationAmount - Normalized interpolation position.
65
+ * @returns Linearly interpolated value.
66
+ */
67
+ export declare function interpolateLinearly(minimumValue: number, maximumValue: number, interpolationAmount: number): number;
68
+ /**
69
+ * Calculates how far a tile lies from the camera's forward center ray.
70
+ *
71
+ * The tile's bounding sphere, rather than only its center, is used so large tiles that intersect
72
+ * the view axis retain center priority. Clamping the nearest point to the forward ray prevents
73
+ * volumes behind the camera from receiving the same priority as centered visible content. The
74
+ * returned angular factor is zero on the view axis and increases toward the edge of a perspective
75
+ * frustum, reaching one for volumes entirely behind the camera.
76
+ *
77
+ * @param boundingVolume - Tile volume used to find the point nearest the camera view axis.
78
+ * @param camera - World-space camera position and normalized view direction.
79
+ * @returns Unitless angular factor, where zero intersects the view axis and larger values are more
80
+ * peripheral.
81
+ */
82
+ export declare function calculateFoveatedFactor(boundingVolume: BoundingSphere | OrientedBoundingBox, camera: FoveatedPriorityCamera): number;
83
+ /**
84
+ * Returns whether a tile supplies the coarse coverage targeted by progressive resolution.
85
+ *
86
+ * In addition to tiles whose reduced-height SSE exceeds the normal threshold, the first child
87
+ * that crosses below the threshold is promoted. Promoting that SSE leaf prevents gaps between
88
+ * coarse hierarchy levels in the initial coverage pass.
89
+ *
90
+ * @param screenSpaceError - Tile SSE calculated at the reduced logical viewport height.
91
+ * @param parentScreenSpaceError - Parent SSE at the same reduced height, when available.
92
+ * @param maximumScreenSpaceError - Normal traversal threshold in logical pixels.
93
+ * @param progressiveResolutionHeightFraction - Reduced-height fraction; values outside `(0, 0.5]`
94
+ * disable progressive priority.
95
+ * @returns `true` when the tile belongs to the initial coarse-coverage priority band.
96
+ */
97
+ export declare function isProgressiveResolutionPriority(screenSpaceError: number, parentScreenSpaceError: number | undefined, maximumScreenSpaceError: number, progressiveResolutionHeightFraction: number): boolean;
98
+ /**
99
+ * Returns whether a peripheral request can wait briefly after camera motion.
100
+ *
101
+ * Traditional `REPLACE` traversal is never deferred because every required child must be ready
102
+ * before its parent disappears. `ADD` traversal and skip-LOD replacement traversal can safely keep
103
+ * already available ancestors while peripheral descendants wait.
104
+ *
105
+ * @param parameters - Refinement, projection, SSE, and foveation measurements for the tile.
106
+ * @returns `true` when the request may wait during the camera-motion delay.
107
+ */
108
+ export declare function isFoveatedRequestDeferred(parameters: FoveatedDeferralParameters): boolean;
109
+ /**
110
+ * Returns whether an eligible foveated request is inside the current camera-motion delay.
111
+ *
112
+ * Eligibility describes geometry and refinement safety; this function adds time. Keeping the
113
+ * active state separate ensures the scheduler removes the temporary hold as soon as the configured
114
+ * delay expires, while invalid timing inputs safely disable the hold.
115
+ *
116
+ * @param deferralEligible - Whether refinement and foveation permit this request to wait.
117
+ * @param timeSinceMovement - Seconds since the current viewport last changed pose.
118
+ * @param foveatedTimeDelay - Maximum delay after motion, in seconds.
119
+ * @returns `true` only while an eligible request remains inside a positive finite delay.
120
+ */
121
+ export declare function isFoveatedRequestDelayActive(deferralEligible: boolean, timeSinceMovement: number, foveatedTimeDelay: number): boolean;
122
+ /**
123
+ * Encodes request priority into independent decimal bands.
124
+ *
125
+ * Smaller values load first. Requests inside the moving-camera delay are kept out of this queue;
126
+ * eligible requests are ordered by the progressive-coverage flag, distance from the view center,
127
+ * and finally the established reverse-SSE order. Normalizing reverse SSE preserves its relative
128
+ * ordering while preventing one metric from spilling into the next priority band.
129
+ *
130
+ * @param parameters - Independent request-priority measurements for a tile.
131
+ * @returns Numeric priority for `RequestScheduler`; smaller values start first.
132
+ */
133
+ export declare function calculateTileRequestPriority(parameters: TileRequestPriorityParameters): number;
134
+ //# sourceMappingURL=tiles-3d-request-priority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ti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;IACvC,iFAAiF;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,uBAAuB,EAAE,MAAM,CAAC;IAChC,kFAAkF;IAClF,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAER;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,GAAG,mBAAmB,EACpD,MAAM,EAAE,sBAAsB,GAC7B,MAAM,CA6BR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,EACxB,sBAAsB,EAAE,MAAM,GAAG,SAAS,EAC1C,uBAAuB,EAAE,MAAM,EAC/B,mCAAmC,EAAE,MAAM,GAC1C,OAAO,CAcT;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,0BAA0B,GAAG,OAAO,CAgDzF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAQT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,6BAA6B,GAAG,MAAM,CAoB9F"}
@@ -0,0 +1,179 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // Copyright vis.gl contributors
4
+ // This file contains behavior derived from the Cesium code base under Apache 2 license.
5
+ import { Vector3 } from '@math.gl/core';
6
+ import { BoundingSphere } from '@math.gl/culling';
7
+ import { TILE_REFINEMENT } from "../../constants.js";
8
+ const PREFERRED_SORTING_DIGITS = 10_000;
9
+ const FOVEATED_SORTING_SCALE = 10_000;
10
+ const PROGRESSIVE_RESOLUTION_PENALTY = 100_000_000;
11
+ const scratchBoundingSphere = new BoundingSphere();
12
+ const scratchCenterOffset = new Vector3();
13
+ const scratchClosestPointOnLine = new Vector3();
14
+ const scratchVectorToLine = new Vector3();
15
+ const scratchClosestPointOnSphere = new Vector3();
16
+ /**
17
+ * Linearly interpolates between two values.
18
+ *
19
+ * @param minimumValue - Value returned when `interpolationAmount` is zero.
20
+ * @param maximumValue - Value returned when `interpolationAmount` is one.
21
+ * @param interpolationAmount - Normalized interpolation position.
22
+ * @returns Linearly interpolated value.
23
+ */
24
+ export function interpolateLinearly(minimumValue, maximumValue, interpolationAmount) {
25
+ return minimumValue + (maximumValue - minimumValue) * interpolationAmount;
26
+ }
27
+ /**
28
+ * Calculates how far a tile lies from the camera's forward center ray.
29
+ *
30
+ * The tile's bounding sphere, rather than only its center, is used so large tiles that intersect
31
+ * the view axis retain center priority. Clamping the nearest point to the forward ray prevents
32
+ * volumes behind the camera from receiving the same priority as centered visible content. The
33
+ * returned angular factor is zero on the view axis and increases toward the edge of a perspective
34
+ * frustum, reaching one for volumes entirely behind the camera.
35
+ *
36
+ * @param boundingVolume - Tile volume used to find the point nearest the camera view axis.
37
+ * @param camera - World-space camera position and normalized view direction.
38
+ * @returns Unitless angular factor, where zero intersects the view axis and larger values are more
39
+ * peripheral.
40
+ */
41
+ export function calculateFoveatedFactor(boundingVolume, camera) {
42
+ const boundingSphere = boundingVolume instanceof BoundingSphere
43
+ ? boundingVolume
44
+ : boundingVolume.getBoundingSphere(scratchBoundingSphere);
45
+ const { center, radius } = boundingSphere;
46
+ scratchCenterOffset.copy(center).subtract(camera.position);
47
+ const centerZDepth = Math.max(scratchCenterOffset.dot(camera.direction), 0);
48
+ scratchClosestPointOnLine.copy(camera.direction).scale(centerZDepth).add(camera.position);
49
+ scratchVectorToLine.copy(scratchClosestPointOnLine).subtract(center);
50
+ const distanceToCenterLine = scratchVectorToLine.magnitude();
51
+ if (distanceToCenterLine <= radius) {
52
+ return 0;
53
+ }
54
+ scratchClosestPointOnSphere
55
+ .copy(scratchVectorToLine)
56
+ .normalize()
57
+ .scale(radius)
58
+ .add(center)
59
+ .subtract(camera.position);
60
+ if (scratchClosestPointOnSphere.magnitude() === 0) {
61
+ return 0;
62
+ }
63
+ scratchClosestPointOnSphere.normalize();
64
+ return Math.min(Math.max(1 - scratchClosestPointOnSphere.dot(camera.direction), 0), 1);
65
+ }
66
+ /**
67
+ * Returns whether a tile supplies the coarse coverage targeted by progressive resolution.
68
+ *
69
+ * In addition to tiles whose reduced-height SSE exceeds the normal threshold, the first child
70
+ * that crosses below the threshold is promoted. Promoting that SSE leaf prevents gaps between
71
+ * coarse hierarchy levels in the initial coverage pass.
72
+ *
73
+ * @param screenSpaceError - Tile SSE calculated at the reduced logical viewport height.
74
+ * @param parentScreenSpaceError - Parent SSE at the same reduced height, when available.
75
+ * @param maximumScreenSpaceError - Normal traversal threshold in logical pixels.
76
+ * @param progressiveResolutionHeightFraction - Reduced-height fraction; values outside `(0, 0.5]`
77
+ * disable progressive priority.
78
+ * @returns `true` when the tile belongs to the initial coarse-coverage priority band.
79
+ */
80
+ export function isProgressiveResolutionPriority(screenSpaceError, parentScreenSpaceError, maximumScreenSpaceError, progressiveResolutionHeightFraction) {
81
+ if (!Number.isFinite(progressiveResolutionHeightFraction) ||
82
+ progressiveResolutionHeightFraction <= 0 ||
83
+ progressiveResolutionHeightFraction > 0.5) {
84
+ return false;
85
+ }
86
+ if (screenSpaceError > maximumScreenSpaceError) {
87
+ return true;
88
+ }
89
+ return parentScreenSpaceError !== undefined && parentScreenSpaceError > maximumScreenSpaceError;
90
+ }
91
+ /**
92
+ * Returns whether a peripheral request can wait briefly after camera motion.
93
+ *
94
+ * Traditional `REPLACE` traversal is never deferred because every required child must be ready
95
+ * before its parent disappears. `ADD` traversal and skip-LOD replacement traversal can safely keep
96
+ * already available ancestors while peripheral descendants wait.
97
+ *
98
+ * @param parameters - Refinement, projection, SSE, and foveation measurements for the tile.
99
+ * @returns `true` when the request may wait during the camera-motion delay.
100
+ */
101
+ export function isFoveatedRequestDeferred(parameters) {
102
+ const coneSize = Number.isFinite(parameters.foveatedConeSize)
103
+ ? Math.min(Math.max(parameters.foveatedConeSize, 0), 1)
104
+ : 1;
105
+ const replacementRefinement = parameters.refinement === TILE_REFINEMENT.REPLACE;
106
+ if ((replacementRefinement && !parameters.skipLevelOfDetail) ||
107
+ !parameters.foveatedScreenSpaceError ||
108
+ coneSize >= 1 ||
109
+ (replacementRefinement &&
110
+ parameters.skipLevelOfDetail &&
111
+ parameters.priorityProgressiveResolution)) {
112
+ return false;
113
+ }
114
+ const verticalFieldOfView = Number.isFinite(parameters.verticalFieldOfView) && parameters.verticalFieldOfView > 0
115
+ ? parameters.verticalFieldOfView
116
+ : Math.PI / 3;
117
+ const maximumFoveatedFactor = 1 - Math.cos(verticalFieldOfView * 0.5);
118
+ const coneFactor = coneSize * maximumFoveatedFactor;
119
+ if (parameters.foveatedFactor <= coneFactor || maximumFoveatedFactor <= coneFactor) {
120
+ return false;
121
+ }
122
+ const interpolationAmount = Math.min(Math.max((parameters.foveatedFactor - coneFactor) / (maximumFoveatedFactor - coneFactor), 0), 1);
123
+ const interpolationCallback = typeof parameters.interpolationCallback === 'function'
124
+ ? parameters.interpolationCallback
125
+ : interpolateLinearly;
126
+ const interpolatedRelaxation = interpolationCallback(parameters.minimumScreenSpaceErrorRelaxation, parameters.maximumScreenSpaceError, interpolationAmount);
127
+ const screenSpaceErrorRelaxation = Number.isFinite(interpolatedRelaxation)
128
+ ? Math.min(Math.max(interpolatedRelaxation, 0), parameters.maximumScreenSpaceError)
129
+ : 0;
130
+ const screenSpaceError = parameters.screenSpaceError === 0 && parameters.parentScreenSpaceError !== undefined
131
+ ? parameters.parentScreenSpaceError * 0.5
132
+ : parameters.screenSpaceError;
133
+ return parameters.maximumScreenSpaceError - screenSpaceErrorRelaxation <= screenSpaceError;
134
+ }
135
+ /**
136
+ * Returns whether an eligible foveated request is inside the current camera-motion delay.
137
+ *
138
+ * Eligibility describes geometry and refinement safety; this function adds time. Keeping the
139
+ * active state separate ensures the scheduler removes the temporary hold as soon as the configured
140
+ * delay expires, while invalid timing inputs safely disable the hold.
141
+ *
142
+ * @param deferralEligible - Whether refinement and foveation permit this request to wait.
143
+ * @param timeSinceMovement - Seconds since the current viewport last changed pose.
144
+ * @param foveatedTimeDelay - Maximum delay after motion, in seconds.
145
+ * @returns `true` only while an eligible request remains inside a positive finite delay.
146
+ */
147
+ export function isFoveatedRequestDelayActive(deferralEligible, timeSinceMovement, foveatedTimeDelay) {
148
+ return (deferralEligible &&
149
+ Number.isFinite(timeSinceMovement) &&
150
+ Number.isFinite(foveatedTimeDelay) &&
151
+ foveatedTimeDelay > 0 &&
152
+ timeSinceMovement < foveatedTimeDelay);
153
+ }
154
+ /**
155
+ * Encodes request priority into independent decimal bands.
156
+ *
157
+ * Smaller values load first. Requests inside the moving-camera delay are kept out of this queue;
158
+ * eligible requests are ordered by the progressive-coverage flag, distance from the view center,
159
+ * and finally the established reverse-SSE order. Normalizing reverse SSE preserves its relative
160
+ * ordering while preventing one metric from spilling into the next priority band.
161
+ *
162
+ * @param parameters - Independent request-priority measurements for a tile.
163
+ * @returns Numeric priority for `RequestScheduler`; smaller values start first.
164
+ */
165
+ export function calculateTileRequestPriority(parameters) {
166
+ const normalizedReverseScreenSpaceError = parameters.rootScreenSpaceError > 0
167
+ ? Math.min(Math.max(parameters.reverseScreenSpaceError / parameters.rootScreenSpaceError, 0), 1)
168
+ : 0;
169
+ const preferredSortingDigits = Math.floor(normalizedReverseScreenSpaceError * (PREFERRED_SORTING_DIGITS - 1));
170
+ const normalizedFoveatedFactor = Number.isFinite(parameters.foveatedFactor)
171
+ ? Math.min(Math.max(parameters.foveatedFactor, 0), 1)
172
+ : 0;
173
+ const foveatedSortingDigits = Math.floor(normalizedFoveatedFactor * (PREFERRED_SORTING_DIGITS - 1)) * FOVEATED_SORTING_SCALE;
174
+ const progressiveResolutionDigits = parameters.priorityProgressiveResolution
175
+ ? 0
176
+ : PROGRESSIVE_RESOLUTION_PENALTY;
177
+ return progressiveResolutionDigits + foveatedSortingDigits + preferredSortingDigits;
178
+ }
179
+ //# sourceMappingURL=tiles-3d-request-priority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiles-3d-request-priority.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/tiles-3d-request-priority.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,8CAA8C;AAC9C,gCAAgC;AAEhC,wFAAwF;AAExF,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,cAAc,EAAsB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,2BAAwB;AAEhD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,MAAM,8BAA8B,GAAG,WAAW,CAAC;AAEnD,MAAM,qBAAqB,GAAG,IAAI,cAAc,EAAE,CAAC;AACnD,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAE,CAAC;AAC1C,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAE,CAAC;AAChD,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAE,CAAC;AAC1C,MAAM,2BAA2B,GAAG,IAAI,OAAO,EAAE,CAAC;AAkElD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAoB,EACpB,YAAoB,EACpB,mBAA2B;IAE3B,OAAO,YAAY,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC,GAAG,mBAAmB,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CACrC,cAAoD,EACpD,MAA8B;IAE9B,MAAM,cAAc,GAClB,cAAc,YAAY,cAAc;QACtC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,cAAc,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IAC9D,MA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,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAClC,iBAAiB,GAAG,CAAC;QACrB,iBAAiB,GAAG,iBAAiB,CACtC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAyC;IACpF,MAAM,iCAAiC,GACrC,UAAU,CAAC,oBAAoB,GAAG,CAAC;QACjC,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,GAAG,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,EACjF,CAAC,CACF;QACH,CAAC,CAAC,CAAC,CAAC;IACR,MAAM,sBAAsB,GAAG,IAAI,CAAC,KAAK,CACvC,iCAAiC,GAAG,CAAC,wBAAwB,GAAG,CAAC,CAAC,CACnE,CAAC;IACF,MAAM,wBAAwB,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC;QACzE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,CAAC;IACN,MAAM,qBAAqB,GACzB,IAAI,CAAC,KAAK,CAAC,wBAAwB,GAAG,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC;IACjG,MAAM,2BAA2B,GAAG,UAAU,CAAC,6BAA6B;QAC1E,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,8BAA8B,CAAC;IACnC,OAAO,2BAA2B,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AACtF,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Tile3D } from "../tile-3d.js";
1
+ import { Tile3D } from "../common/tile-3d.js";
2
2
  export declare function calculateTransformProps(tileHeader: Tile3D, tile: Tile3D['content']): void;
3
3
  //# sourceMappingURL=transform-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-utils.d.ts","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/transform-utils.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,MAAM,EAAC,6BAA0B;AAEzC,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,QAyElF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-utils.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/transform-utils.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAIhD,MAAM,UAAU,uBAAuB,CAAC,UAAkB,EAAE,IAAuB;IACjF,MAAM,CAAC,UAAU,CAAC,CAAC;IACnB,MAAM,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,EAAC,SAAS,EAAE,UAAU,EAAC,GAAG,IAAI,CAAC;IACrC,MAAM,EACJ,iBAAiB,EACjB,cAAc,EAAE,EAAC,MAAM,EAAC,EACzB,GAAG,UAAU,CAAC;IAEf,IAAI,WAAW,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEjD,2BAA2B;IAC3B,IAAI,SAAS,EAAE,CAAC;QACd,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,gDAAgD;IAChD,2FAA2F;IAC3F,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,GAAG;YACN,MAAM;QACR,KAAK,GAAG;YACN,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACrD,WAA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AAO,IAAI,CAAC;IAEnE,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/zoom.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAC,iBAAiB,EAAC,uBAAoB;AAQ9C;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,cAAc,GAAG,mBAAmB,GAAG,iBAAiB,EACxE,mBAAmB,EAAE,OAAO,UAwB7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE;IACV,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,EACD,mBAAmB,EAAE,OAAO,EAC5B,eAAe,EAAE,OAAO,UAYzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxC,mBAAmB,EAAE,OAAO,EAC5B,eAAe,EAAE,OAAO,UAQzB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/zoom.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9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