@cesium/engine 26.2.0 → 26.3.1-wasm.0

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 (393) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +707 -600
  2. package/Build/Workers/chunk-2P3WKV6V.js +290 -0
  3. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
  4. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
  5. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
  6. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
  7. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
  8. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
  9. package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
  10. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
  11. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
  12. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
  13. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
  14. package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
  15. package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
  16. package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
  17. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
  18. package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
  19. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
  20. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
  21. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
  22. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
  23. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
  24. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
  25. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
  26. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
  27. package/Build/Workers/chunk-NYKURYFR.js +2131 -0
  28. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
  29. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
  30. package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
  31. package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
  32. package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
  33. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
  34. package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
  35. package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
  36. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
  37. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
  38. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
  39. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
  40. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
  41. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
  42. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
  43. package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
  44. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
  45. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
  46. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
  47. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
  48. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
  49. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
  50. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
  52. package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
  53. package/Build/Workers/chunk-YUICDZKO.js +2660 -0
  54. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
  55. package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
  56. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
  57. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
  58. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
  59. package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
  60. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
  61. package/Build/Workers/combineGeometry.js +24 -24
  62. package/Build/Workers/createBoxGeometry.js +18 -18
  63. package/Build/Workers/createBoxOutlineGeometry.js +20 -19
  64. package/Build/Workers/createCircleGeometry.js +28 -27
  65. package/Build/Workers/createCircleOutlineGeometry.js +21 -20
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
  68. package/Build/Workers/createCorridorGeometry.js +31 -31
  69. package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
  70. package/Build/Workers/createCylinderGeometry.js +20 -20
  71. package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
  72. package/Build/Workers/createEllipseGeometry.js +26 -26
  73. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  74. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  76. package/Build/Workers/createFrustumGeometry.js +18 -18
  77. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  78. package/Build/Workers/createGeometry.js +27 -26
  79. package/Build/Workers/createGroundPolylineGeometry.js +27 -26
  80. package/Build/Workers/createPlaneGeometry.js +18 -17
  81. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  82. package/Build/Workers/createPolygonGeometry.js +35 -35
  83. package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
  84. package/Build/Workers/createPolylineGeometry.js +28 -29
  85. package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
  87. package/Build/Workers/createRectangleGeometry.js +30 -30
  88. package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
  89. package/Build/Workers/createSimplePolylineGeometry.js +26 -27
  90. package/Build/Workers/createSphereGeometry.js +19 -19
  91. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  92. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  93. package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
  94. package/Build/Workers/createVectorTileGeometries.js +24 -24
  95. package/Build/Workers/createVectorTilePoints.js +13 -13
  96. package/Build/Workers/createVectorTilePolygons.js +22 -22
  97. package/Build/Workers/createVectorTilePolylines.js +17 -16
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
  100. package/Build/Workers/createVerticesFromHeightmap.js +24 -25
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  102. package/Build/Workers/createWallGeometry.js +27 -28
  103. package/Build/Workers/createWallOutlineGeometry.js +26 -27
  104. package/Build/Workers/decodeDraco.js +16 -12
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
  106. package/Build/Workers/decodeI3S.js +17 -12
  107. package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
  108. package/Build/Workers/decodeSpz.js +1960 -0
  109. package/Build/Workers/gaussianSplatSorter.js +13 -6
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
  112. package/Build/Workers/transcodeKTX2.js +26 -12
  113. package/Build/Workers/transferTypedArrayTest.js +1 -1
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  116. package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
  117. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/IonResource.js +5 -0
  120. package/Source/Core/IonSnapGeometryType.js +59 -0
  121. package/Source/Core/IonSnapHeat.js +33 -0
  122. package/Source/Core/IonSnapMode.js +45 -0
  123. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  124. package/Source/Core/IonSnapService.js +369 -0
  125. package/Source/Core/KTX2Transcoder.js +99 -5
  126. package/Source/Core/Resource.js +2 -0
  127. package/Source/Core/SnapService.js +63 -0
  128. package/Source/Core/TaskProcessor.js +249 -129
  129. package/Source/Core/TrustedServers.js +34 -1
  130. package/Source/Core/VectorPipeline.js +139 -45
  131. package/Source/Core/VectorProvider.js +311 -71
  132. package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
  133. package/Source/Core/fetchWebAssemblyBinary.js +52 -0
  134. package/Source/Renderer/AutomaticUniforms.js +44 -2
  135. package/Source/Renderer/ShaderBuilder.js +1 -1
  136. package/Source/Renderer/UniformState.js +47 -1
  137. package/Source/Scene/ArcGisMapService.js +1 -1
  138. package/Source/Scene/BufferPointCollection.js +4 -7
  139. package/Source/Scene/BufferPolygonCollection.js +56 -27
  140. package/Source/Scene/BufferPolylineCollection.js +61 -8
  141. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  142. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  143. package/Source/Scene/Cesium3DTile.js +12 -0
  144. package/Source/Scene/Cesium3DTileset.js +61 -8
  145. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  146. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  147. package/Source/Scene/ClippingPolygon.js +154 -100
  148. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  149. package/Source/Scene/CreditDisplay.js +62 -0
  150. package/Source/Scene/GaussianSplatPrimitive.js +153 -66
  151. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  152. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  153. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  154. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  155. package/Source/Scene/GltfBufferViewLoader.js +25 -13
  156. package/Source/Scene/GltfLoader.js +56 -6
  157. package/Source/Scene/GltfSpzLoader.js +5 -4
  158. package/Source/Scene/HeightReference.js +1 -1
  159. package/Source/Scene/MVTDataProvider.js +9 -0
  160. package/Source/Scene/Model/Model.js +242 -16
  161. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  162. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  163. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  164. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  165. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  166. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  167. package/Source/Scene/PostProcessStage.js +22 -3
  168. package/Source/Scene/Scene.js +56 -1
  169. package/Source/Scene/Snapping.js +57 -0
  170. package/Source/Scene/SpzDecoder.js +106 -0
  171. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  172. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  173. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  174. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  175. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  178. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  179. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  180. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  181. package/Source/Shaders/GlobeFS.glsl +10 -9
  182. package/Source/Shaders/GlobeFS.js +11 -9
  183. package/Source/Shaders/GlobeVS.glsl +0 -32
  184. package/Source/Shaders/GlobeVS.js +0 -32
  185. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  186. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  187. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  188. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  189. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  190. package/Source/Shaders/Model/ModelFS.js +4 -0
  191. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  192. package/Source/Shaders/Model/ModelVS.js +7 -2
  193. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  194. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  195. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  196. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  197. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  198. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  199. package/Source/Shaders/VectorCommon.glsl +177 -50
  200. package/Source/Shaders/VectorCommon.js +251 -19
  201. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  202. package/Source/ThirdParty/zip-module.wasm +0 -0
  203. package/Source/Workers/createTaskProcessorWorker.js +2 -0
  204. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
  205. package/Source/Workers/decodeDraco.js +7 -3
  206. package/Source/Workers/decodeI3S.js +7 -3
  207. package/Source/Workers/decodeMeshopt.js +21 -0
  208. package/Source/Workers/decodeSpz.js +20 -0
  209. package/Source/Workers/gaussianSplatSorter.js +7 -3
  210. package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
  211. package/Source/Workers/transcodeKTX2.js +22 -5
  212. package/index.d.ts +649 -55
  213. package/index.js +23 -13
  214. package/package.json +6 -6
  215. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  216. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  217. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  218. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  219. package/Build/Workers/chunk-36NI5E6W.js +0 -3820
  220. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  221. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  222. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  223. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  224. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  225. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  226. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  227. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  228. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  229. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  230. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  231. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  232. package/Build/Workers/chunk-5YPQBFRD.js +0 -519
  233. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  234. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  235. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  236. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  237. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  238. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  239. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  240. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  241. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  242. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  243. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  244. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  245. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  246. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  247. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  248. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  249. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  250. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  251. package/Build/Workers/chunk-AHWAZRBV.js +0 -82
  252. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  253. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  254. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  255. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  256. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  257. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  258. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  259. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  260. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  261. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  262. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  263. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  264. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  265. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  266. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  267. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  268. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  269. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  270. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  271. package/Build/Workers/chunk-EOWDZN5S.js +0 -288
  272. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  273. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  274. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  275. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  276. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  277. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  278. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  279. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  280. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  281. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  282. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  283. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  284. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  285. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  286. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  287. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  288. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  289. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  290. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  291. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  292. package/Build/Workers/chunk-ILME5BXA.js +0 -301
  293. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  294. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  295. package/Build/Workers/chunk-J73T2VOY.js +0 -171
  296. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  297. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  298. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  299. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  300. package/Build/Workers/chunk-KMV25A63.js +0 -789
  301. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  302. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  303. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  304. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  305. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  306. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  307. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  308. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  309. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  310. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  311. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  312. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  313. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  314. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  315. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  316. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  317. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  318. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  319. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  320. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  321. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  322. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  323. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  324. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  325. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  326. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  327. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  328. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  329. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  330. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  331. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  332. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  333. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  334. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  335. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  336. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  337. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  338. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  339. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  340. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  341. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  342. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  343. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  344. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  345. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  346. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  347. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  348. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  349. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  350. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  351. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  352. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  353. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  354. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  355. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  356. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  357. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  358. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  359. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  360. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  361. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  362. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  363. package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
  364. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  365. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  366. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  367. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  368. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  369. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  370. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  371. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  372. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  373. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  374. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  375. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  376. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  377. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  378. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  379. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  380. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  381. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  382. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  383. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  384. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  385. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  386. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  387. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  388. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  389. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  390. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  391. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  392. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  393. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -162,6 +162,29 @@ function styleLightboxContainer(that) {
162
162
  }
163
163
  }
164
164
 
165
+ /**
166
+ * Wraps a callback so that it also runs when a keyboard user activates an element
167
+ * with <code>Enter</code> or <code>Space</code>. Elements exposed as <code>role="button"</code>
168
+ * are expected to respond to both keys, which anchors without an <code>href</code> do not do natively.
169
+ *
170
+ * @param {Function} callback The function to invoke when the element is activated.
171
+ * @returns {Function} A <code>keydown</code> handler.
172
+ *
173
+ * @private
174
+ */
175
+ function activateOnKeydown(callback) {
176
+ return function (event) {
177
+ if (event.key !== "Enter" && event.key !== " ") {
178
+ return;
179
+ }
180
+ // Prevent Space from scrolling the page and stop the event from also
181
+ // reaching the overlay, which would immediately close the lightbox again.
182
+ event.preventDefault();
183
+ event.stopPropagation();
184
+ callback();
185
+ };
186
+ }
187
+
165
188
  function appendCss(container) {
166
189
  const style = /*css*/ `
167
190
  .cesium-credit-lightbox-overlay {
@@ -237,6 +260,12 @@ function appendCss(container) {
237
260
  color: ${highlightColor};
238
261
  }
239
262
 
263
+ .cesium-credit-expand-link:focus-visible,
264
+ .cesium-credit-lightbox-close:focus-visible {
265
+ outline: 2px solid ${highlightColor};
266
+ outline-offset: 2px;
267
+ }
268
+
240
269
  .cesium-credit-text {
241
270
  color: ${textColor};
242
271
  }
@@ -312,6 +341,9 @@ function CreditDisplay(container, delimiter, viewport) {
312
341
 
313
342
  const lightboxCredits = document.createElement("div");
314
343
  lightboxCredits.className = "cesium-credit-lightbox";
344
+ lightboxCredits.setAttribute("role", "dialog");
345
+ lightboxCredits.setAttribute("aria-modal", "true");
346
+ lightboxCredits.setAttribute("aria-label", "Data attribution");
315
347
  lightbox.appendChild(lightboxCredits);
316
348
 
317
349
  function hideLightbox(event) {
@@ -322,6 +354,14 @@ function CreditDisplay(container, delimiter, viewport) {
322
354
  }
323
355
  lightbox.addEventListener("click", hideLightbox, false);
324
356
 
357
+ function hideLightboxOnEscape(event) {
358
+ if (event.key === "Escape") {
359
+ event.preventDefault();
360
+ that.hideLightbox();
361
+ }
362
+ }
363
+ lightbox.addEventListener("keydown", hideLightboxOnEscape, false);
364
+
325
365
  const title = document.createElement("div");
326
366
  title.className = "cesium-credit-lightbox-title";
327
367
  title.textContent = "Data provided by:";
@@ -329,8 +369,12 @@ function CreditDisplay(container, delimiter, viewport) {
329
369
 
330
370
  const closeButton = document.createElement("a");
331
371
  closeButton.onclick = this.hideLightbox.bind(this);
372
+ closeButton.onkeydown = activateOnKeydown(this.hideLightbox.bind(this));
332
373
  closeButton.innerHTML = "&times;";
333
374
  closeButton.className = "cesium-credit-lightbox-close";
375
+ closeButton.setAttribute("role", "button");
376
+ closeButton.setAttribute("tabindex", "0");
377
+ closeButton.setAttribute("aria-label", "Close data attribution");
334
378
  lightboxCredits.appendChild(closeButton);
335
379
 
336
380
  const creditList = document.createElement("ul");
@@ -349,7 +393,12 @@ function CreditDisplay(container, delimiter, viewport) {
349
393
  const expandLink = document.createElement("a");
350
394
  expandLink.className = "cesium-credit-expand-link";
351
395
  expandLink.onclick = this.showLightbox.bind(this);
396
+ expandLink.onkeydown = activateOnKeydown(this.showLightbox.bind(this));
352
397
  expandLink.textContent = "Data attribution";
398
+ expandLink.setAttribute("role", "button");
399
+ expandLink.setAttribute("tabindex", "0");
400
+ expandLink.setAttribute("aria-haspopup", "dialog");
401
+ expandLink.setAttribute("aria-expanded", "false");
353
402
  container.appendChild(expandLink);
354
403
 
355
404
  appendCss(container);
@@ -364,7 +413,9 @@ function CreditDisplay(container, delimiter, viewport) {
364
413
  this._creditList = creditList;
365
414
  this._lightbox = lightbox;
366
415
  this._hideLightbox = hideLightbox;
416
+ this._hideLightboxOnEscape = hideLightboxOnEscape;
367
417
  this._expandLink = expandLink;
418
+ this._closeButton = closeButton;
368
419
  this._expanded = false;
369
420
  this._staticCredits = [];
370
421
  this._cesiumCredit = cesiumCredit;
@@ -492,6 +543,9 @@ CreditDisplay.prototype.removeStaticCredit = function (credit) {
492
543
  CreditDisplay.prototype.showLightbox = function () {
493
544
  this._lightbox.style.display = "block";
494
545
  this._expanded = true;
546
+ this._expandLink.setAttribute("aria-expanded", "true");
547
+ // Move focus into the dialog so keyboard users can reach its contents.
548
+ this._closeButton.focus();
495
549
  };
496
550
 
497
551
  /**
@@ -500,6 +554,9 @@ CreditDisplay.prototype.showLightbox = function () {
500
554
  CreditDisplay.prototype.hideLightbox = function () {
501
555
  this._lightbox.style.display = "none";
502
556
  this._expanded = false;
557
+ this._expandLink.setAttribute("aria-expanded", "false");
558
+ // Restore focus to the element that opened the dialog.
559
+ this._expandLink.focus();
503
560
  };
504
561
 
505
562
  /**
@@ -581,6 +638,11 @@ CreditDisplay.prototype.endFrame = function () {
581
638
  */
582
639
  CreditDisplay.prototype.destroy = function () {
583
640
  this._lightbox.removeEventListener("click", this._hideLightbox, false);
641
+ this._lightbox.removeEventListener(
642
+ "keydown",
643
+ this._hideLightboxOnEscape,
644
+ false,
645
+ );
584
646
 
585
647
  this.container.removeChild(this._cesiumCreditContainer);
586
648
  this.container.removeChild(this._screenContainer);
@@ -35,6 +35,7 @@ import SplitDirection from "./SplitDirection.js";
35
35
  import destroyObject from "../Core/destroyObject.js";
36
36
  import ContextLimits from "../Renderer/ContextLimits.js";
37
37
  import Transforms from "../Core/Transforms.js";
38
+ import getTimestamp from "../Core/getTimestamp.js";
38
39
 
39
40
  const scratchMatrix4A = new Matrix4();
40
41
  const scratchMatrix4C = new Matrix4();
@@ -144,12 +145,114 @@ const SnapshotState = {
144
145
  * @private
145
146
  */
146
147
 
147
- // Two stable frames avoids rebuilding during brief selected-tile jitter.
148
- const DEFAULT_STABLE_FRAMES = 2;
149
- // If selection keeps changing, force a rebuild after ~0.5s at 60fps to guarantee progress.
150
- // Lower values react faster but can thrash on noisy LOD transitions.
151
- // Higher values reduce rebuild churn but keep stale snapshots visible longer.
152
- const DEFAULT_MAX_SNAPSHOT_STALL_FRAMES = 30;
148
+ // A snapshot rebuild re-aggregates every selected tile and re-uploads the
149
+ // splat textures. Each rebuild is a burst of main-thread and GPU work, so the
150
+ // scheduler waits for the selected tile set to settle before starting one.
151
+ //
152
+ // Both values below were tuned by hand on one dev machine. They have not been
153
+ // measured across hardware or network speeds (coming shortly).
154
+
155
+ // How long the selected tile set must stay unchanged, with no tiles decoding
156
+ // or downloading, before a rebuild may start.
157
+ const DEFAULT_SNAPSHOT_DEBOUNCE_MILLISECONDS = 500;
158
+
159
+ // Upper bound on how long a pending rebuild can wait while the selection keeps
160
+ // changing. Once passed, a rebuild is forced unless a committed snapshot
161
+ // already covers most of the selected tiles (see the overlap check in
162
+ // SnapshotRebuildScheduler.update).
163
+ const DEFAULT_MAX_SNAPSHOT_WAIT_MILLISECONDS = 2000;
164
+
165
+ class SnapshotRebuildScheduler {
166
+ constructor() {
167
+ this._selectedTileSet = new Set();
168
+ this._selectionChangedTime = undefined;
169
+ this._pendingSince = undefined;
170
+ this._lastRebuildTileSet = undefined;
171
+ }
172
+
173
+ get isPending() {
174
+ return defined(this._pendingSince);
175
+ }
176
+
177
+ hasSelectedTile(tile) {
178
+ return this._selectedTileSet.has(tile);
179
+ }
180
+
181
+ update(
182
+ timestamp,
183
+ {
184
+ selectedTiles,
185
+ rebuildRequested,
186
+ isBootstrap,
187
+ tilesLoaded,
188
+ tilesInFlight = false,
189
+ hasCommittedSnapshot = false,
190
+ },
191
+ ) {
192
+ if (selectedTiles.length === 0) {
193
+ this.clear();
194
+ return false;
195
+ }
196
+
197
+ const selectedTilesChanged = haveSelectedTilesChanged(
198
+ this._selectedTileSet,
199
+ selectedTiles,
200
+ );
201
+ if (selectedTilesChanged) {
202
+ this._selectedTileSet = new Set(selectedTiles);
203
+ this._selectionChangedTime = timestamp;
204
+ }
205
+
206
+ if (
207
+ (selectedTilesChanged || rebuildRequested || isBootstrap) &&
208
+ !this.isPending
209
+ ) {
210
+ this._pendingSince = timestamp;
211
+ }
212
+
213
+ if (!this.isPending) {
214
+ return false;
215
+ }
216
+
217
+ const selectionIsStable =
218
+ !tilesInFlight &&
219
+ defined(this._selectionChangedTime) &&
220
+ timestamp - this._selectionChangedTime >=
221
+ DEFAULT_SNAPSHOT_DEBOUNCE_MILLISECONDS;
222
+
223
+ let tileOverlap = 0;
224
+ if (defined(this._lastRebuildTileSet)) {
225
+ for (const tile of this._selectedTileSet) {
226
+ if (this._lastRebuildTileSet.has(tile)) {
227
+ tileOverlap++;
228
+ }
229
+ }
230
+ tileOverlap /= this._selectedTileSet.size;
231
+ }
232
+
233
+ const deadlineReached =
234
+ timestamp - this._pendingSince >=
235
+ DEFAULT_MAX_SNAPSHOT_WAIT_MILLISECONDS &&
236
+ // If the committed snapshot still covers at least half of the selected
237
+ // tiles, the stale view is close enough to keep showing. Skip the forced
238
+ // rebuild and wait for the selection to settle or for tilesLoaded.
239
+ (!hasCommittedSnapshot || tileOverlap < 0.5);
240
+
241
+ return isBootstrap || tilesLoaded || selectionIsStable || deadlineReached;
242
+ }
243
+
244
+ markRebuildStarted() {
245
+ this._lastRebuildTileSet = new Set(this._selectedTileSet);
246
+ this._pendingSince = undefined;
247
+ }
248
+
249
+ clear() {
250
+ this._selectedTileSet.clear();
251
+ this._selectionChangedTime = undefined;
252
+ this._pendingSince = undefined;
253
+ }
254
+ }
255
+
153
256
  // Minimum delay between steady re-sort requests once the camera is moving.
154
257
  const DEFAULT_SORT_MIN_FRAME_INTERVAL = 3;
155
258
  // ~0.5 degree camera direction change threshold before triggering steady re-sort.
@@ -236,23 +339,18 @@ function markSteadySortStart(primitive, frameState) {
236
339
  }
237
340
 
238
341
  /**
239
- * Checks whether the set of currently selected tiles differs from the set
240
- * recorded on the primitive. This is used to detect LOD transitions that
241
- * require a snapshot rebuild.
242
- *
243
- * @param {GaussianSplatPrimitive} primitive The splat primitive.
244
- * @param {Cesium3DTile[]} selectedTiles The tiles selected this frame.
245
- * @returns {boolean} {@code true} if the tile set has changed.
342
+ * @param {Set<Cesium3DTile>} previousTiles The prior selected tile set.
343
+ * @param {Cesium3DTile[]} selectedTiles The current selected tiles.
344
+ * @returns {boolean} Whether the tile set changed.
246
345
  * @private
247
346
  */
248
- function haveSelectedTilesChanged(primitive, selectedTiles) {
249
- const prevSet = primitive._selectedTileSet;
250
- if (!defined(prevSet) || prevSet.size !== selectedTiles.length) {
347
+ function haveSelectedTilesChanged(previousTiles, selectedTiles) {
348
+ if (previousTiles.size !== selectedTiles.length) {
251
349
  return true;
252
350
  }
253
351
 
254
352
  for (let i = 0; i < selectedTiles.length; i++) {
255
- if (!prevSet.has(selectedTiles[i])) {
353
+ if (!previousTiles.has(selectedTiles[i])) {
256
354
  return true;
257
355
  }
258
356
  }
@@ -868,9 +966,7 @@ function GaussianSplatPrimitive(options) {
868
966
  * @private
869
967
  */
870
968
  this._scratchAggregateShBuffer = undefined;
871
- this._selectedTilesStableFrames = 0;
872
- this._needsSnapshotRebuild = false;
873
- this._snapshotRebuildStallFrames = 0;
969
+ this._snapshotRebuildScheduler = new SnapshotRebuildScheduler();
874
970
 
875
971
  /**
876
972
  * The previous view matrix used to determine if the primitive needs to be updated.
@@ -957,7 +1053,6 @@ function GaussianSplatPrimitive(options) {
957
1053
  * @private
958
1054
  */
959
1055
  this.selectedTileLength = 0;
960
- this._selectedTileSet = new Set();
961
1056
 
962
1057
  /**
963
1058
  * Indicates whether or not the primitive is ready for use.
@@ -1096,6 +1191,7 @@ Object.defineProperties(GaussianSplatPrimitive.prototype, {
1096
1191
  get: function () {
1097
1192
  return (
1098
1193
  !this._dirty &&
1194
+ !this._snapshotRebuildScheduler.isPending &&
1099
1195
  (!defined(this._pendingSnapshot) ||
1100
1196
  this._pendingSnapshot.state === SnapshotState.READY)
1101
1197
  );
@@ -1197,14 +1293,15 @@ GaussianSplatPrimitive.prototype.isDestroyed = function () {
1197
1293
  };
1198
1294
 
1199
1295
  /**
1200
- * Event callback for when a tile is loaded.
1201
- * This method is called when a tile is loaded and the primitive needs to be updated.
1202
- * It sets the dirty flag to true, indicating that the primitive needs to be rebuilt.
1296
+ * Marks the primitive dirty when a selected tile loads new content.
1297
+ * Loads outside the selected set do not affect the current snapshot.
1203
1298
  * @param {Cesium3DTile} tile
1204
1299
  * @private
1205
1300
  */
1206
1301
  GaussianSplatPrimitive.prototype.onTileLoad = function (tile) {
1207
- this._dirty = true;
1302
+ if (this._snapshotRebuildScheduler.hasSelectedTile(tile)) {
1303
+ this._dirty = true;
1304
+ }
1208
1305
  };
1209
1306
 
1210
1307
  /**
@@ -1711,43 +1808,32 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
1711
1808
  return;
1712
1809
  }
1713
1810
 
1811
+ const selectedTiles = tileset._selectedTiles;
1812
+ const hasSelectedTiles = selectedTiles.length !== 0;
1813
+ const statistics = tileset.statistics;
1814
+ const isBootstrap =
1815
+ !defined(this._snapshot) &&
1816
+ !defined(this._pendingSnapshot) &&
1817
+ !defined(this._drawCommand);
1818
+ const allowSnapshotRebuild = this._snapshotRebuildScheduler.update(
1819
+ getTimestamp(),
1820
+ {
1821
+ selectedTiles: selectedTiles,
1822
+ rebuildRequested: this._dirty,
1823
+ isBootstrap: isBootstrap,
1824
+ tilesLoaded: tileset.tilesLoaded,
1825
+ tilesInFlight:
1826
+ defined(statistics) &&
1827
+ (statistics.numberOfTilesProcessing > 0 ||
1828
+ statistics.numberOfPendingRequests > 0),
1829
+ hasCommittedSnapshot: defined(this._snapshot),
1830
+ },
1831
+ );
1832
+
1714
1833
  if (this._sorterState === GaussianSplatSortingState.IDLE) {
1715
- const selectedTilesChanged =
1716
- tileset._selectedTiles.length !== 0 &&
1717
- haveSelectedTilesChanged(this, tileset._selectedTiles);
1718
- if (tileset._selectedTiles.length === 0) {
1719
- this._selectedTilesStableFrames = 0;
1720
- this._needsSnapshotRebuild = false;
1721
- this._snapshotRebuildStallFrames = 0;
1722
- } else if (selectedTilesChanged) {
1723
- this._selectedTilesStableFrames = 0;
1724
- } else {
1725
- this._selectedTilesStableFrames++;
1726
- }
1727
- if (selectedTilesChanged || this._dirty) {
1728
- this._needsSnapshotRebuild = true;
1729
- }
1730
- const isStable = this._selectedTilesStableFrames >= DEFAULT_STABLE_FRAMES;
1731
- const isBootstrap =
1732
- !defined(this._snapshot) &&
1733
- !defined(this._pendingSnapshot) &&
1734
- !defined(this._drawCommand);
1735
- // This prevents an indefinite wait if selected tiles never settle completely.
1736
- // In practice, this is the upper bound on "wait-for-stability" before forcing
1737
- // a rebuild to avoid visible starvation.
1738
- if (this._needsSnapshotRebuild && tileset._selectedTiles.length !== 0) {
1739
- this._snapshotRebuildStallFrames++;
1740
- } else {
1741
- this._snapshotRebuildStallFrames = 0;
1742
- }
1743
- const allowRebuild =
1744
- isStable ||
1745
- isBootstrap ||
1746
- this._snapshotRebuildStallFrames >= DEFAULT_MAX_SNAPSHOT_STALL_FRAMES;
1747
1834
  const hasPendingWork =
1748
1835
  this._dirty ||
1749
- this._needsSnapshotRebuild ||
1750
- selectedTilesChanged ||
1836
+ this._snapshotRebuildScheduler.isPending ||
1751
1837
  defined(this._pendingSnapshot) ||
1752
1838
  defined(this._pendingSortPromise) ||
1753
1839
  !defined(this._drawCommand);
@@ -1759,10 +1845,11 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
1759
1845
  }
1760
1846
 
1761
1847
  if (
1762
- tileset._selectedTiles.length !== 0 &&
1763
- this._needsSnapshotRebuild &&
1764
- allowRebuild
1848
+ hasSelectedTiles &&
1849
+ this._snapshotRebuildScheduler.isPending &&
1850
+ allowSnapshotRebuild
1765
1851
  ) {
1852
+ this._snapshotRebuildScheduler.markRebuildStarted();
1766
1853
  this._splatDataGeneration++;
1767
1854
  this._activeSort = undefined;
1768
1855
  this._sorterPromise = undefined;
@@ -1971,11 +2058,8 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
1971
2058
  state: SnapshotState.BUILDING,
1972
2059
  };
1973
2060
 
1974
- this.selectedTileLength = tileset._selectedTiles.length;
1975
- this._selectedTileSet = new Set(tileset._selectedTiles);
2061
+ this.selectedTileLength = selectedTiles.length;
1976
2062
  this._dirty = false;
1977
- this._needsSnapshotRebuild = false;
1978
- this._snapshotRebuildStallFrames = 0;
1979
2063
  }
1980
2064
 
1981
2065
  if (defined(this._pendingSnapshot)) {
@@ -2144,4 +2228,7 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
2144
2228
  this._dirty = false;
2145
2229
  };
2146
2230
 
2231
+ // For testing.
2232
+ GaussianSplatPrimitive._SnapshotRebuildScheduler = SnapshotRebuildScheduler;
2233
+
2147
2234
  export default GaussianSplatPrimitive;
@@ -1,8 +1,5 @@
1
1
  // @ts-check
2
2
 
3
- /** @import {GeoJson, GeoJsonFeature, GeoJsonGeometry, GeoJsonPosition} from "../Core/globalTypes.js"; */
4
- /** @import FrameState from "./FrameState.js"; */
5
-
6
3
  import Cartesian2 from "../Core/Cartesian2.js";
7
4
  import Cartesian3 from "../Core/Cartesian3.js";
8
5
  import Check from "../Core/Check.js";
@@ -11,6 +8,7 @@ import destroyObject from "../Core/destroyObject.js";
11
8
  import DeveloperError from "../Core/DeveloperError.js";
12
9
  import Ellipsoid from "../Core/Ellipsoid.js";
13
10
  import Frozen from "../Core/Frozen.js";
11
+ import HeightReference, { isHeightReferenceClamp } from "./HeightReference.js";
14
12
  import PolygonPipeline from "../Core/PolygonPipeline.js";
15
13
  import Resource from "../Core/Resource.js";
16
14
  import RuntimeError from "../Core/RuntimeError.js";
@@ -20,6 +18,13 @@ import BufferPolygon from "./BufferPolygon.js";
20
18
  import BufferPolygonCollection from "./BufferPolygonCollection.js";
21
19
  import BufferPolyline from "./BufferPolyline.js";
22
20
  import BufferPolylineCollection from "./BufferPolylineCollection.js";
21
+ import assert from "../Core/assert.js";
22
+ import oneTimeWarning from "../Core/oneTimeWarning.js";
23
+
24
+ /** @import FrameState from "./FrameState.js"; */
25
+ /** @import Scene from "./Scene.js"; */
26
+ /** @import {GeoJson, GeoJsonFeature, GeoJsonGeometry, GeoJsonPosition} from "../Core/globalTypes.js"; */
27
+ /** @import VectorProvider from "../Core/VectorProvider.js"; */
23
28
 
24
29
  /**
25
30
  * @typedef {object} GeoJsonPrimitiveConstructorOptions
@@ -29,6 +34,9 @@ import BufferPolylineCollection from "./BufferPolylineCollection.js";
29
34
  * @property {boolean} [allowPicking=true]
30
35
  * @property {boolean} [show=true]
31
36
  * @property {function(number, object, Record<string, unknown>):object} [pickObjectFactory]
37
+ * @property {HeightReference} [heightReference=HeightReference.NONE] Allows clamping (draping)
38
+ * polylines and polygons on terrain and 3D Tiles. Point clamping is not currently supported.
39
+ * @property {Scene} [scene] Required for primitives that use a clamping {@link HeightReference}.
32
40
  */
33
41
 
34
42
  /**
@@ -41,14 +49,36 @@ import BufferPolylineCollection from "./BufferPolylineCollection.js";
41
49
  * added directly to {@link Scene#primitives}.
42
50
  *
43
51
  * @example
52
+ * // Load GeoJSON
44
53
  * const loader = await Cesium.GeoJsonPrimitive.fromUrl("./data.geojson");
45
54
  * viewer.scene.primitives.add(loader);
46
55
  *
56
+ * @example
57
+ * // Access GeoJSON features and properties
47
58
  * loader.points; // BufferPointCollection | undefined
48
59
  * loader.polylines; // BufferPolylineCollection | undefined
49
60
  * loader.polygons; // BufferPolygonCollection | undefined
50
61
  * loader.ids; // source feature IDs
51
62
  * loader.properties; // source feature properties
63
+ *
64
+ * @example
65
+ * // Style GeoJSON
66
+ * const material = new Cesium.BufferPolylineMaterial({
67
+ * color: Cesium.Color.RED,
68
+ * width: 4,
69
+ * });
70
+ *
71
+ * const polyline = new Cesium.BufferPolyline();
72
+ * const count = primitive.polylines.primitiveCount;
73
+ * for (let i = 0; i < count; i++) {
74
+ * primitive.polylines.get(i, polyline);
75
+ *
76
+ * const properties = primitive.getProperties(polyline.featureId);
77
+ * if (properties.myCustomProperty === true) {
78
+ * polyline.setMaterial(material);
79
+ * }
80
+ * }
81
+ *
52
82
  * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
53
83
  */
54
84
  class GeoJsonPrimitive {
@@ -59,9 +89,7 @@ class GeoJsonPrimitive {
59
89
  options = options ?? Frozen.EMPTY_OBJECT;
60
90
 
61
91
  //>>includeStart('debug', pragmas.debug);
62
- if (!defined(options.geoJson)) {
63
- throw new DeveloperError("options.geoJson is required.");
64
- }
92
+ Check.defined("geoJson", options.geoJson);
65
93
  //>>includeEnd('debug');
66
94
 
67
95
  const parseResult = parseGeoJson(/** @type {GeoJson} */ (options.geoJson));
@@ -86,35 +114,62 @@ class GeoJsonPrimitive {
86
114
  this._polylines = undefined;
87
115
  this._polygons = undefined;
88
116
 
117
+ /**
118
+ * @type {HeightReference}
119
+ * @private
120
+ */
121
+ this._heightReference = options.heightReference ?? HeightReference.NONE;
122
+
123
+ /**
124
+ * @type {Scene|undefined}
125
+ * @private
126
+ */
127
+ this._scene = options.scene;
128
+
129
+ const heightReference = this._heightReference;
130
+ const scene = this._scene;
131
+
132
+ //>>includeStart('debug', pragmas.debug);
133
+ assert(
134
+ !isHeightReferenceClamp(heightReference) || defined(scene),
135
+ "Clamped HeightReference requires `options.scene`.",
136
+ );
137
+ //>>includeEnd('debug');
138
+
89
139
  if (parseResult.pointCount > 0) {
90
- /** @type {Record<string, unknown>} */
91
- const pointOptions = {
140
+ //>>includeStart('debug', pragmas.debug);
141
+ if (isHeightReferenceClamp(heightReference)) {
142
+ oneTimeWarning(
143
+ "geojson-heightref",
144
+ "Clamped HeightReference unsupported on BufferPointCollection.",
145
+ );
146
+ }
147
+ //>>includeEnd('debug');
148
+
149
+ this._points = new BufferPointCollection({
92
150
  primitiveCountMax: parseResult.pointCount,
93
151
  allowPicking: allowPicking,
94
- };
95
- this._points = new BufferPointCollection(pointOptions);
152
+ });
96
153
  }
97
154
 
98
155
  if (parseResult.polylineCount > 0) {
99
- /** @type {Record<string, unknown>} */
100
- const polylineOptions = {
156
+ this._polylines = new BufferPolylineCollection({
101
157
  primitiveCountMax: parseResult.polylineCount,
102
158
  vertexCountMax: parseResult.polylineVertexCount,
103
159
  allowPicking: allowPicking,
104
- };
105
- this._polylines = new BufferPolylineCollection(polylineOptions);
160
+ heightReference,
161
+ });
106
162
  }
107
163
 
108
164
  if (parseResult.polygonCount > 0) {
109
- /** @type {Record<string, unknown>} */
110
- const polygonOptions = {
165
+ this._polygons = new BufferPolygonCollection({
111
166
  primitiveCountMax: parseResult.polygonCount,
112
167
  vertexCountMax: parseResult.polygonVertexCount,
113
168
  holeCountMax: parseResult.polygonHoleCount,
114
169
  triangleCountMax: parseResult.polygonTriangleCount,
115
170
  allowPicking: allowPicking,
116
- };
117
- this._polygons = new BufferPolygonCollection(polygonOptions);
171
+ heightReference,
172
+ });
118
173
  }
119
174
 
120
175
  const scratch = new Cartesian3();
@@ -338,30 +393,65 @@ class GeoJsonPrimitive {
338
393
  return;
339
394
  }
340
395
 
341
- if (defined(this._points)) {
342
- this._points.update(frameState);
396
+ const points = this._points;
397
+ const polylines = this._polylines;
398
+ const polygons = this._polygons;
399
+ const frameNumber = frameState.frameNumber;
400
+ const heightReference = this._heightReference;
401
+
402
+ const vectorProvider = isHeightReferenceClamp(heightReference)
403
+ ? // @ts-expect-error Missing types, non-ES6 class.
404
+ /** @type {VectorProvider} */ (this._scene.vectorProvider)
405
+ : null;
406
+
407
+ if (defined(points)) {
408
+ points.update(frameState);
343
409
  }
344
- if (defined(this._polylines)) {
345
- this._polylines.update(frameState);
410
+
411
+ if (defined(polylines)) {
412
+ if (defined(vectorProvider)) {
413
+ vectorProvider.markForFrame(polylines, frameNumber, heightReference);
414
+ } else {
415
+ polylines.update(frameState);
416
+ }
346
417
  }
347
- if (defined(this._polygons)) {
348
- this._polygons.update(frameState);
418
+
419
+ if (defined(polygons)) {
420
+ if (defined(vectorProvider)) {
421
+ vectorProvider.markForFrame(polygons, frameNumber, heightReference);
422
+ } else {
423
+ polygons.update(frameState);
424
+ }
349
425
  }
350
426
  }
351
427
 
352
428
  destroy() {
429
+ const vectorProvider = isHeightReferenceClamp(this._heightReference)
430
+ ? // @ts-expect-error Missing types, non-ES6 class.
431
+ /** @type {VectorProvider} */ (this._scene.vectorProvider)
432
+ : null;
433
+
353
434
  if (this._points) {
354
435
  this._points.destroy();
355
436
  this._points = undefined;
356
437
  }
438
+
357
439
  if (this._polylines) {
440
+ if (defined(vectorProvider)) {
441
+ vectorProvider.remove(this._polylines);
442
+ }
358
443
  this._polylines.destroy();
359
444
  this._polylines = undefined;
360
445
  }
446
+
361
447
  if (this._polygons) {
448
+ if (defined(vectorProvider)) {
449
+ vectorProvider.remove(this._polygons);
450
+ }
362
451
  this._polygons.destroy();
363
452
  this._polygons = undefined;
364
453
  }
454
+
365
455
  return destroyObject(this);
366
456
  }
367
457