@cesium/engine 26.1.0 → 26.3.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 (325) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +764 -520
  2. package/Build/Workers/{chunk-HS6AD4P2.js → chunk-2DKJSPYF.js} +14 -14
  3. package/Build/Workers/{chunk-QVLAFFJY.js → chunk-2PWVICP6.js} +1 -1
  4. package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
  5. package/Build/Workers/{chunk-ENNFMWDW.js → chunk-4DMAXPKB.js} +12 -12
  6. package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-4LRFYRBX.js} +2 -2
  7. package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
  8. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
  9. package/Build/Workers/{chunk-A6X24AZI.js → chunk-6BSNYZZG.js} +5 -5
  10. package/Build/Workers/{chunk-IGAZBTFZ.js → chunk-6R6SGKYN.js} +6 -6
  11. package/Build/Workers/{chunk-SS5ABQGY.js → chunk-6V2KDEHL.js} +4 -4
  12. package/Build/Workers/{chunk-ZMBHFYOX.js → chunk-75BC2IHI.js} +7 -7
  13. package/Build/Workers/{chunk-LGNDTZVX.js → chunk-7SESBH2I.js} +4 -4
  14. package/Build/Workers/{chunk-CLCTQVVL.js → chunk-7WXBTNRV.js} +8 -8
  15. package/Build/Workers/{chunk-WBSY7HDY.js → chunk-A7SMPV6B.js} +12 -12
  16. package/Build/Workers/{chunk-CEEZE3YZ.js → chunk-ATSXKJ3L.js} +7 -7
  17. package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
  18. package/Build/Workers/{chunk-6HK6IXK2.js → chunk-B7Q2WF6Q.js} +4 -4
  19. package/Build/Workers/{chunk-YKU2Q3A2.js → chunk-BNDSDQ7D.js} +9 -12
  20. package/Build/Workers/{chunk-R4FPNAZ2.js → chunk-CKK6CUXK.js} +9 -9
  21. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
  22. package/Build/Workers/{chunk-7D2HZKH7.js → chunk-CQ4TZXAT.js} +7 -7
  23. package/Build/Workers/{chunk-TVZD72WJ.js → chunk-DKSANM4A.js} +12 -12
  24. package/Build/Workers/{chunk-FDK4K5IA.js → chunk-DZK34ZVD.js} +1 -1
  25. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
  26. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
  27. package/Build/Workers/{chunk-2EFYUSUY.js → chunk-F34TJJLA.js} +16 -16
  28. package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
  29. package/Build/Workers/{chunk-T5QBPLE3.js → chunk-GS7RY2DH.js} +11 -11
  30. package/Build/Workers/{chunk-C7JQVRLM.js → chunk-HDD3RFLT.js} +25 -3
  31. package/Build/Workers/{chunk-E7NZJOK7.js → chunk-HDPNFEPP.js} +121 -93
  32. package/Build/Workers/{chunk-VAL7DYNR.js → chunk-JBJ6BRIM.js} +4 -4
  33. package/Build/Workers/{chunk-XQ3SKCMM.js → chunk-JKTWW7IO.js} +5 -5
  34. package/Build/Workers/{chunk-UVO6COT2.js → chunk-JL4NWWQY.js} +5 -5
  35. package/Build/Workers/{chunk-DBD5WWG2.js → chunk-JMUUAW4X.js} +10 -10
  36. package/Build/Workers/{chunk-UEY73NRN.js → chunk-KBGAHN5R.js} +1 -1
  37. package/Build/Workers/{chunk-LD64RPYV.js → chunk-KEWK6VZL.js} +12 -12
  38. package/Build/Workers/{chunk-JW6OZT4R.js → chunk-L73K5UPP.js} +10 -10
  39. package/Build/Workers/{chunk-DIGUUD6G.js → chunk-LL2SGJYH.js} +6 -6
  40. package/Build/Workers/{chunk-XLXSDIP5.js → chunk-LYJUL4XQ.js} +6 -6
  41. package/Build/Workers/{chunk-SM2CDCYF.js → chunk-M6W46OAP.js} +7 -7
  42. package/Build/Workers/{chunk-EHTS2YPT.js → chunk-MDDKCLMF.js} +17 -17
  43. package/Build/Workers/{chunk-FGQFQHN5.js → chunk-MUW4DJV7.js} +18 -18
  44. package/Build/Workers/{chunk-HHV3MCGV.js → chunk-N5YK44FS.js} +5 -5
  45. package/Build/Workers/{chunk-RG4F5R57.js → chunk-NZQUP52G.js} +9 -9
  46. package/Build/Workers/{chunk-B4CQSLZJ.js → chunk-PKZA44LH.js} +6 -6
  47. package/Build/Workers/{chunk-OBEU25PI.js → chunk-Q2JS5LCB.js} +17 -17
  48. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
  49. package/Build/Workers/{chunk-NIWITKQK.js → chunk-SEJIXZZ4.js} +11 -11
  50. package/Build/Workers/{chunk-SGRGNDOD.js → chunk-SL2HCFYW.js} +10 -10
  51. package/Build/Workers/{chunk-SF6K72D7.js → chunk-SLHK3KAR.js} +5 -5
  52. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
  53. package/Build/Workers/{chunk-LNSQVXFH.js → chunk-VRECSMG3.js} +2 -2
  54. package/Build/Workers/{chunk-A3O6EDBK.js → chunk-X27HKF5E.js} +2 -2
  55. package/Build/Workers/{chunk-7KVKHY7O.js → chunk-XBY3354M.js} +6 -6
  56. package/Build/Workers/{chunk-GSWMAFTE.js → chunk-XRZCS3HE.js} +23 -16
  57. package/Build/Workers/{chunk-6YR6JBMY.js → chunk-XSIUYAT6.js} +2 -2
  58. package/Build/Workers/{chunk-ZSGUV73H.js → chunk-Z2DW5NM2.js} +6 -6
  59. package/Build/Workers/combineGeometry.js +24 -24
  60. package/Build/Workers/createBoxGeometry.js +18 -18
  61. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  62. package/Build/Workers/createCircleGeometry.js +26 -26
  63. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  64. package/Build/Workers/createCoplanarPolygonGeometry.js +35 -35
  65. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  66. package/Build/Workers/createCorridorGeometry.js +31 -33
  67. package/Build/Workers/createCorridorOutlineGeometry.js +29 -31
  68. package/Build/Workers/createCylinderGeometry.js +20 -20
  69. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  70. package/Build/Workers/createEllipseGeometry.js +26 -26
  71. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  73. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  74. package/Build/Workers/createFrustumGeometry.js +18 -18
  75. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  76. package/Build/Workers/createGeometry.js +24 -24
  77. package/Build/Workers/createGroundPolylineGeometry.js +24 -24
  78. package/Build/Workers/createPlaneGeometry.js +16 -16
  79. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  80. package/Build/Workers/createPolygonGeometry.js +34 -34
  81. package/Build/Workers/createPolygonOutlineGeometry.js +31 -31
  82. package/Build/Workers/createPolylineGeometry.js +26 -26
  83. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  84. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  85. package/Build/Workers/createRectangleGeometry.js +27 -27
  86. package/Build/Workers/createRectangleOutlineGeometry.js +21 -21
  87. package/Build/Workers/createSimplePolylineGeometry.js +24 -24
  88. package/Build/Workers/createSphereGeometry.js +19 -19
  89. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  90. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  91. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  92. package/Build/Workers/createVectorTileGeometries.js +24 -24
  93. package/Build/Workers/createVectorTilePoints.js +13 -13
  94. package/Build/Workers/createVectorTilePolygons.js +22 -22
  95. package/Build/Workers/createVectorTilePolylines.js +14 -14
  96. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  97. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  98. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  99. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  100. package/Build/Workers/createWallGeometry.js +24 -24
  101. package/Build/Workers/createWallOutlineGeometry.js +24 -24
  102. package/Build/Workers/decodeDraco.js +10 -10
  103. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  104. package/Build/Workers/decodeI3S.js +10 -10
  105. package/Build/Workers/gaussianSplatSorter.js +4 -4
  106. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  107. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  108. package/Build/Workers/transcodeKTX2.js +6 -6
  109. package/Build/Workers/transferTypedArrayTest.js +1 -1
  110. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  111. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  112. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
  113. package/Source/Core/BoundingSphere.js +0 -3
  114. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
  115. package/Source/Core/CoplanarPolygonGeometry.js +2 -2
  116. package/Source/Core/CorridorGeometry.js +2 -4
  117. package/Source/Core/CorridorOutlineGeometry.js +1 -3
  118. package/Source/Core/EarthOrientationParameters.js +2 -2
  119. package/Source/Core/EllipseGeometryLibrary.js +2 -2
  120. package/Source/Core/EllipsoidGeodesic.js +3 -3
  121. package/Source/Core/EllipsoidRhumbLine.js +1 -1
  122. package/Source/Core/GroundPolylineGeometry.js +2 -2
  123. package/Source/Core/Heap.js +1 -1
  124. package/Source/Core/HermitePolynomialApproximation.js +215 -179
  125. package/Source/Core/InterpolationAlgorithm.js +1 -0
  126. package/Source/Core/Ion.js +1 -1
  127. package/Source/Core/IonResource.js +5 -0
  128. package/Source/Core/IonSnapGeometryType.js +59 -0
  129. package/Source/Core/IonSnapHeat.js +33 -0
  130. package/Source/Core/IonSnapMode.js +45 -0
  131. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  132. package/Source/Core/IonSnapService.js +369 -0
  133. package/Source/Core/JulianDate.js +1 -1
  134. package/Source/Core/LagrangePolynomialApproximation.js +55 -52
  135. package/Source/Core/LinearApproximation.js +69 -66
  136. package/Source/Core/Math.js +59 -0
  137. package/Source/Core/Matrix2.js +2 -2
  138. package/Source/Core/Matrix3.js +2 -2
  139. package/Source/Core/OrthographicFrustum.js +1 -1
  140. package/Source/Core/PerspectiveFrustum.js +1 -1
  141. package/Source/Core/PolygonGeometry.js +2 -2
  142. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  143. package/Source/Core/PolygonOutlineGeometry.js +1 -1
  144. package/Source/Core/PolylineGeometry.js +1 -1
  145. package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
  146. package/Source/Core/Rectangle.js +7 -1
  147. package/Source/Core/RectangleOutlineGeometry.js +1 -1
  148. package/Source/Core/SimplePolylineGeometry.js +1 -1
  149. package/Source/Core/SnapService.js +63 -0
  150. package/Source/Core/TerrainEncoding.js +2 -2
  151. package/Source/Core/TerrainPicker.js +179 -168
  152. package/Source/Core/TimeIntervalCollection.js +1 -3
  153. package/Source/Core/Tipsify.js +1 -1
  154. package/Source/Core/Transforms.js +5 -1
  155. package/Source/Core/VectorPipeline.js +1211 -0
  156. package/Source/Core/VectorProvider.js +669 -0
  157. package/Source/Core/WallOutlineGeometry.js +1 -1
  158. package/Source/Core/getTimestamp.js +4 -2
  159. package/Source/DataSources/CompositeEntityCollection.js +0 -1
  160. package/Source/DataSources/CzmlDataSource.js +2 -0
  161. package/Source/DataSources/DataSourceDisplay.js +1 -1
  162. package/Source/DataSources/GeoJsonDataSource.js +0 -1
  163. package/Source/DataSources/GeometryVisualizer.js +1 -1
  164. package/Source/DataSources/KmlDataSource.js +1 -2
  165. package/Source/DataSources/PolylineVisualizer.js +1 -1
  166. package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
  167. package/Source/Renderer/AutomaticUniforms.js +67 -2
  168. package/Source/Renderer/Context.js +9 -3
  169. package/Source/Renderer/DrawCommand.js +22 -0
  170. package/Source/Renderer/Framebuffer.js +4 -0
  171. package/Source/Renderer/Pass.js +11 -10
  172. package/Source/Renderer/ShaderBuilder.js +1 -1
  173. package/Source/Renderer/Texture.js +11 -0
  174. package/Source/Renderer/UniformState.js +54 -1
  175. package/Source/Renderer/VertexArray.js +0 -1
  176. package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
  177. package/Source/Scene/ArcGisMapService.js +1 -1
  178. package/Source/Scene/Billboard.js +2 -1
  179. package/Source/Scene/BillboardCollection.js +7 -3
  180. package/Source/Scene/BufferPointCollection.js +4 -7
  181. package/Source/Scene/BufferPolygonCollection.js +56 -27
  182. package/Source/Scene/BufferPolylineCollection.js +61 -8
  183. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  184. package/Source/Scene/BufferPrimitiveCollection.js +226 -34
  185. package/Source/Scene/Camera.js +71 -5
  186. package/Source/Scene/Cesium3DTile.js +12 -0
  187. package/Source/Scene/Cesium3DTileset.js +62 -9
  188. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  189. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  190. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  191. package/Source/Scene/ClippingPolygon.js +154 -100
  192. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  193. package/Source/Scene/Controllers/Controller.js +63 -0
  194. package/Source/Scene/Controllers/ControllerHost.js +78 -0
  195. package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
  196. package/Source/Scene/Controllers/MouseButton.js +32 -0
  197. package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
  198. package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
  199. package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
  200. package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
  201. package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
  202. package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
  203. package/Source/Scene/CreditDisplay.js +62 -0
  204. package/Source/Scene/DerivedCommand.js +94 -0
  205. package/Source/Scene/EdgeFramebuffer.js +1 -5
  206. package/Source/Scene/FrameState.js +17 -0
  207. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  208. package/Source/Scene/Globe.js +20 -0
  209. package/Source/Scene/GlobeDepth.js +27 -1
  210. package/Source/Scene/GlobeSurfaceShaderSet.js +42 -53
  211. package/Source/Scene/GlobeSurfaceTile.js +61 -10
  212. package/Source/Scene/GlobeSurfaceTileProvider.js +351 -26
  213. package/Source/Scene/GltfLoader.js +88 -9
  214. package/Source/Scene/GltfSpzLoader.js +1 -1
  215. package/Source/Scene/GltfVertexBufferLoader.js +6 -3
  216. package/Source/Scene/HeightReference.js +1 -1
  217. package/Source/Scene/I3SDataProvider.js +1 -1
  218. package/Source/Scene/I3SLayer.js +1 -1
  219. package/Source/Scene/I3SNode.js +2 -2
  220. package/Source/Scene/ImageryLayerCollection.js +188 -4
  221. package/Source/Scene/IonImageryProvider.js +1 -5
  222. package/Source/Scene/Label.js +4 -4
  223. package/Source/Scene/LabelCollection.js +1 -1
  224. package/Source/Scene/MVTDataProvider.js +11 -0
  225. package/Source/Scene/Model/B3dmLoader.js +1 -2
  226. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
  227. package/Source/Scene/Model/I3dmLoader.js +1 -1
  228. package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
  229. package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
  230. package/Source/Scene/Model/Model.js +250 -26
  231. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  232. package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
  233. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  234. package/Source/Scene/Model/ModelDrawCommand.js +160 -16
  235. package/Source/Scene/Model/ModelDrawCommands.js +4 -0
  236. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  237. package/Source/Scene/Model/ModelSceneGraph.js +31 -1
  238. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  239. package/Source/Scene/Model/PickingPipelineStage.js +33 -0
  240. package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
  241. package/Source/Scene/ModelComponents.js +71 -0
  242. package/Source/Scene/Picking.js +16 -5
  243. package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
  244. package/Source/Scene/PntsParser.js +0 -1
  245. package/Source/Scene/PolylineCollection.js +1 -1
  246. package/Source/Scene/PostProcessStage.js +26 -5
  247. package/Source/Scene/ResourceCache.js +7 -4
  248. package/Source/Scene/ResourceCacheKey.js +16 -13
  249. package/Source/Scene/Scene.js +258 -6
  250. package/Source/Scene/ScreenSpaceCameraController.js +1 -2
  251. package/Source/Scene/ShadowMap.js +9 -3
  252. package/Source/Scene/ShadowMapShader.js +50 -2
  253. package/Source/Scene/SnapFramebuffer.js +121 -0
  254. package/Source/Scene/Snapping.js +241 -0
  255. package/Source/Scene/TerrainFillMesh.js +3 -2
  256. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +13 -2
  257. package/Source/Scene/Vector3DTileContent.js +2 -3
  258. package/Source/Scene/VectorGltf3DTileContent.js +31 -3
  259. package/Source/Scene/View.js +10 -8
  260. package/Source/Scene/VoxelTraversal.js +1 -1
  261. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  262. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  263. package/Source/Scene/createElevationBandMaterial.js +1 -1
  264. package/Source/Scene/renderBufferPointCollection.js +1 -2
  265. package/Source/Scene/renderBufferPolygonCollection.js +1 -2
  266. package/Source/Scene/renderBufferPolylineCollection.js +6 -3
  267. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  268. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  269. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  270. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  271. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  272. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  273. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  274. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  275. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
  276. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
  277. package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
  278. package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
  279. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  280. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  281. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  282. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  283. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  284. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  285. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  286. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  287. package/Source/Shaders/Builtin/CzmBuiltins.js +4 -4
  288. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  289. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  290. package/Source/Shaders/GlobeFS.glsl +20 -14
  291. package/Source/Shaders/GlobeFS.js +20 -14
  292. package/Source/Shaders/GlobeVS.glsl +0 -32
  293. package/Source/Shaders/GlobeVS.js +0 -32
  294. package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
  295. package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
  296. package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
  297. package/Source/Shaders/Model/MaterialStageFS.js +8 -2
  298. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  299. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  300. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  301. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  302. package/Source/Shaders/Model/ModelFS.glsl +109 -0
  303. package/Source/Shaders/Model/ModelFS.js +109 -0
  304. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  305. package/Source/Shaders/Model/ModelVS.js +7 -2
  306. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  307. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  308. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  309. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  310. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  311. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  312. package/Source/Shaders/VectorCommon.glsl +305 -0
  313. package/Source/Shaders/VectorCommon.js +307 -0
  314. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  315. package/Source/ThirdParty/zip-module.wasm +0 -0
  316. package/Source/Widget/CesiumWidget.js +30 -0
  317. package/index.d.ts +1326 -65
  318. package/index.js +179 -155
  319. package/package.json +6 -6
  320. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  321. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  322. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  323. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  324. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  325. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -497,6 +497,8 @@ function getPropertyType(czmlInterval) {
497
497
  return Object;
498
498
  } else if (czmlInterval.hasOwnProperty("unitQuaternion")) {
499
499
  return Quaternion;
500
+ } else if (czmlInterval.hasOwnProperty("pathMode")) {
501
+ return PathMode;
500
502
  } else if (czmlInterval.hasOwnProperty("shadowMode")) {
501
503
  return ShadowMode;
502
504
  } else if (czmlInterval.hasOwnProperty("string")) {
@@ -415,7 +415,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function (
415
415
  const tmp = getBoundingSphereBoundingSphereScratch;
416
416
 
417
417
  let count = 0;
418
- let state = BoundingSphereState.DONE;
418
+ let state;
419
419
  const visualizers = dataSource._visualizers;
420
420
  const visualizersLength = visualizers.length;
421
421
 
@@ -149,7 +149,6 @@ function createObject(geoJson, entityCollection, describe) {
149
149
  const lowerKey = key.toLowerCase();
150
150
 
151
151
  if (namePropertyPrecedence > 1 && lowerKey === "title") {
152
- namePropertyPrecedence = 1;
153
152
  nameProperty = key;
154
153
  break;
155
154
  } else if (namePropertyPrecedence > 2 && lowerKey === "name") {
@@ -336,7 +336,7 @@ GeometryVisualizer.prototype.getBoundingSphere = function (entity, result) {
336
336
  const tmp = getBoundingSphereBoundingSphereScratch;
337
337
 
338
338
  let count = 0;
339
- let state = BoundingSphereState.DONE;
339
+ let state;
340
340
  const batches = this._batches;
341
341
  const batchesLength = batches.length;
342
342
 
@@ -1495,9 +1495,8 @@ function processPositionGraphics(
1495
1495
  billboard.image = undefined;
1496
1496
  }
1497
1497
 
1498
- let scale = 1.0;
1499
1498
  if (defined(billboard.scale)) {
1500
- scale = billboard.scale.getValue();
1499
+ const scale = billboard.scale.getValue();
1501
1500
  if (scale !== 0) {
1502
1501
  label.pixelOffset = new Cartesian2(scale * 16 + 1, 0);
1503
1502
  } else {
@@ -295,7 +295,7 @@ PolylineVisualizer.prototype.getBoundingSphere = function (entity, result) {
295
295
  const tmp = getBoundingSphereBoundingSphereScratch;
296
296
 
297
297
  let count = 0;
298
- let state = BoundingSphereState.DONE;
298
+ let state;
299
299
  const batches = this._batches;
300
300
  const batchesLength = batches.length;
301
301
  const updater = this._updaters.get(entity.id);
@@ -375,7 +375,7 @@ StaticOutlineGeometryBatch.prototype.update = function (time) {
375
375
  const translucentBatchesLength = translucentBatches.length;
376
376
  let itemsToRemove;
377
377
  let isUpdated = true;
378
- let needUpdate = false;
378
+ let needUpdate;
379
379
 
380
380
  do {
381
381
  needUpdate = false;
@@ -222,6 +222,29 @@ const AutomaticUniforms = {
222
222
  },
223
223
  }),
224
224
 
225
+ /**
226
+ * An automatic GLSL uniform containing the feature-ID texture produced by
227
+ * the planar fill pre-pass (BENTLEY_materials_planar_fill). Non-behind
228
+ * planar fill geometry writes its per-fragment feature ID here so that
229
+ * behind fills can test whether the existing pixel belongs to the same
230
+ * logical object.
231
+ *
232
+ * @example
233
+ * // GLSL declaration
234
+ * uniform sampler2D czm_planarFillIdTexture;
235
+ *
236
+ * // Sample
237
+ * vec2 coords = gl_FragCoord.xy / czm_viewport.zw;
238
+ * float existingFeatureId = texture(czm_planarFillIdTexture, coords).r;
239
+ */
240
+ czm_planarFillIdTexture: new AutomaticUniform({
241
+ size: 1,
242
+ datatype: WebGLConstants.SAMPLER_2D,
243
+ getValue: function (uniformState) {
244
+ return uniformState.planarFillIdTexture;
245
+ },
246
+ }),
247
+
225
248
  /**
226
249
  * An automatic GLSL uniform representing a 4x4 model transformation matrix that
227
250
  * transforms model coordinates to world coordinates.
@@ -985,6 +1008,27 @@ const AutomaticUniforms = {
985
1008
  },
986
1009
  }),
987
1010
 
1011
+ /**
1012
+ * An automatic GLSL uniform containing the geodetic longitude (<code>x</code>),
1013
+ * latitude (<code>y</code>) in radians and height (<code>z</code>) in meters of the
1014
+ * eye (camera). The <code>z</code> component matches {@link czm_eyeHeight}.
1015
+ * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
1016
+ *
1017
+ * @example
1018
+ * // GLSL declaration
1019
+ * uniform vec3 czm_eyeCartographic;
1020
+ *
1021
+ * // Example
1022
+ * float cameraLatitude = czm_eyeCartographic.y;
1023
+ */
1024
+ czm_eyeCartographic: new AutomaticUniform({
1025
+ size: 1,
1026
+ datatype: WebGLConstants.FLOAT_VEC3,
1027
+ getValue: function (uniformState) {
1028
+ return uniformState.eyeCartographic;
1029
+ },
1030
+ }),
1031
+
988
1032
  /**
989
1033
  * An automatic GLSL uniform containing height (<code>x</code>) and height squared (<code>y</code>)
990
1034
  * in meters of the eye (camera) above the 2D world plane. This uniform is only valid
@@ -1027,10 +1071,31 @@ const AutomaticUniforms = {
1027
1071
  },
1028
1072
  }),
1029
1073
 
1074
+ /**
1075
+ * An automatic GLSL uniform containing a 3x3 rotation from eye coordinates to an
1076
+ * east-north-up coordinate system centered at the position on the ellipsoid below
1077
+ * the camera.
1078
+ * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
1079
+ *
1080
+ * @example
1081
+ * // GLSL declaration
1082
+ * uniform mat3 czm_eyeToEnu;
1083
+ *
1084
+ * // Example
1085
+ * vec3 enu = czm_eyeToEnu * positionEC;
1086
+ */
1087
+ czm_eyeToEnu: new AutomaticUniform({
1088
+ size: 1,
1089
+ datatype: WebGLConstants.FLOAT_MAT3,
1090
+ getValue: function (uniformState) {
1091
+ return uniformState.eyeToEnu;
1092
+ },
1093
+ }),
1094
+
1030
1095
  /**
1031
1096
  * An automatic GLSL uniform containing the transform from model coordinates
1032
1097
  * to an east-north-up coordinate system centered at the position on the
1033
- * ellipsoid below the camera.
1098
+ * ellipsoid nearest to the camera.
1034
1099
  * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
1035
1100
  */
1036
1101
  czm_modelToEnu: new AutomaticUniform({
@@ -1042,7 +1107,7 @@ const AutomaticUniforms = {
1042
1107
  }),
1043
1108
 
1044
1109
  /**
1045
- * An automatic GLSL uniform containing the the inverse of
1110
+ * An automatic GLSL uniform containing the inverse of
1046
1111
  * {@link AutomaticUniforms.czm_modelToEnu}.
1047
1112
  * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
1048
1113
  */
@@ -1010,20 +1010,26 @@ Object.defineProperties(Context.prototype, {
1010
1010
  },
1011
1011
 
1012
1012
  /**
1013
- * A 1x1 RGBA texture initialized to [255, 255, 255, 255]. This can
1014
- * be used as a placeholder texture while other textures are downloaded.
1013
+ * A 1x1 RGBA texture initialized to the color defined by {@link Texture.defaultColor}.
1014
+ * This can be used as a placeholder texture while other textures are downloaded.
1015
1015
  * @memberof Context.prototype
1016
1016
  * @type {Texture}
1017
1017
  */
1018
1018
  defaultTexture: {
1019
1019
  get: function () {
1020
1020
  if (this._defaultTexture === undefined) {
1021
+ const color = Texture.defaultColor;
1021
1022
  this._defaultTexture = new Texture({
1022
1023
  context: this,
1023
1024
  source: {
1024
1025
  width: 1,
1025
1026
  height: 1,
1026
- arrayBufferView: new Uint8Array([255, 255, 255, 255]),
1027
+ arrayBufferView: new Uint8Array([
1028
+ color.red * 255,
1029
+ color.green * 255,
1030
+ color.blue * 255,
1031
+ color.alpha * 255,
1032
+ ]),
1027
1033
  },
1028
1034
  flipY: false,
1029
1035
  });
@@ -47,6 +47,7 @@ const Flags = {
47
47
  * @property {Pass} [pass]
48
48
  * @property {object} [owner]
49
49
  * @property {string} [pickId]
50
+ * @property {string} [snapId]
50
51
  * @property {boolean} [pickMetadataAllowed=false]
51
52
  * @property {boolean} [cull=true]
52
53
  * @property {boolean} [occlude=true]
@@ -102,6 +103,7 @@ class DrawCommand {
102
103
  this._debugOverlappingFrustums = 0;
103
104
  /** @private */
104
105
  this._pickId = options.pickId;
106
+ this._snapId = options.snapId;
105
107
  /** @private */
106
108
  this._pickMetadataAllowed = options.pickMetadataAllowed === true;
107
109
  /**
@@ -532,6 +534,25 @@ class DrawCommand {
532
534
  }
533
535
  }
534
536
 
537
+ /**
538
+ * A GLSL string that will evaluate to the float snap payload written during
539
+ * a snapping pass (see {@link Scene#snap}). When <code>undefined</code>, the
540
+ * command does not render during a snapping pass.
541
+ *
542
+ * @type {string|undefined}
543
+ * @default undefined
544
+ */
545
+ get snapId() {
546
+ return this._snapId;
547
+ }
548
+
549
+ set snapId(value) {
550
+ if (this._snapId !== value) {
551
+ this._snapId = value;
552
+ this.dirty = true;
553
+ }
554
+ }
555
+
535
556
  /**
536
557
  * Whether metadata picking is allowed.
537
558
  *
@@ -628,6 +649,7 @@ class DrawCommand {
628
649
  result._owner = command._owner;
629
650
  result._debugOverlappingFrustums = command._debugOverlappingFrustums;
630
651
  result._pickId = command._pickId;
652
+ result._snapId = command._snapId;
631
653
  result._pickMetadataAllowed = command._pickMetadataAllowed;
632
654
  result._pickedMetadataInfo = command._pickedMetadataInfo;
633
655
  result._flags = command._flags;
@@ -287,6 +287,10 @@ function Framebuffer(options) {
287
287
  }
288
288
 
289
289
  this._unBind();
290
+
291
+ // _bind and _unBind bypass the context's framebuffer binding cache. The GL
292
+ // binding is now the default framebuffer; update the cache to match.
293
+ context._currentFramebuffer = undefined;
290
294
  }
291
295
 
292
296
  Object.defineProperties(Framebuffer.prototype, {
@@ -19,16 +19,17 @@ const Pass = {
19
19
  GLOBE: 2,
20
20
  TERRAIN_CLASSIFICATION: 3,
21
21
  CESIUM_3D_TILE_EDGES: 4,
22
- CESIUM_3D_TILE: 5,
23
- CESIUM_3D_TILE_CLASSIFICATION: 6,
24
- CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW: 7,
25
- OPAQUE: 8,
26
- TRANSLUCENT: 9,
27
- VOXELS: 10,
28
- GAUSSIAN_SPLATS: 11,
29
- CESIUM_3D_TILE_EDGES_DIRECT: 12,
30
- OVERLAY: 13,
31
- NUMBER_OF_PASSES: 14,
22
+ CESIUM_3D_TILE_PLANAR_FILL_ID: 5,
23
+ CESIUM_3D_TILE: 6,
24
+ CESIUM_3D_TILE_CLASSIFICATION: 7,
25
+ CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW: 8,
26
+ OPAQUE: 9,
27
+ TRANSLUCENT: 10,
28
+ VOXELS: 11,
29
+ GAUSSIAN_SPLATS: 12,
30
+ CESIUM_3D_TILE_EDGES_DIRECT: 13,
31
+ OVERLAY: 14,
32
+ NUMBER_OF_PASSES: 15,
32
33
  };
33
34
 
34
35
  Object.freeze(Pass);
@@ -424,7 +424,7 @@ ShaderBuilder.prototype.addVertexLines = function (lines) {
424
424
  /**
425
425
  * Appends lines of GLSL code to the fragment shader
426
426
  *
427
- * @param {string[]} lines The lines to add to the end of the fragment shader source
427
+ * @param {string|string[]} lines One or more lines to add to the end of the fragment shader source
428
428
  *
429
429
  * @example
430
430
  * shaderBuilder.addFragmentLines([
@@ -1,5 +1,6 @@
1
1
  import Cartesian2 from "../Core/Cartesian2.js";
2
2
  import Check from "../Core/Check.js";
3
+ import Color from "../Core/Color.js";
3
4
  import createGuid from "../Core/createGuid.js";
4
5
  import Frozen from "../Core/Frozen.js";
5
6
  import defined from "../Core/defined.js";
@@ -1123,4 +1124,14 @@ Texture.prototype.destroy = function () {
1123
1124
  this._context._gl.deleteTexture(this._texture);
1124
1125
  return destroyObject(this);
1125
1126
  };
1127
+
1128
+ /**
1129
+ * The default color used as a placeholder texture while other textures are downloaded.
1130
+ * This can be changed globally to customize the placeholder appearance.
1131
+ *
1132
+ * @type {Color}
1133
+ * @default Color.WHITE
1134
+ */
1135
+ Texture.defaultColor = Color.WHITE;
1136
+
1126
1137
  export default Texture;
@@ -37,6 +37,13 @@ function UniformState() {
37
37
  * @type {Texture}
38
38
  */
39
39
  this.edgeDepthTexture = undefined; // packed depth color attachment from edge pass
40
+ /**
41
+ * Texture written by the planar fill feature-ID pre-pass.
42
+ * Contains per-pixel feature IDs for non-behind planar fill geometry.
43
+ * Sampled by behind fills to test same-object coplanarity.
44
+ * @type {Texture}
45
+ */
46
+ this.planarFillIdTexture = undefined;
40
47
  /**
41
48
  * @type {number}
42
49
  */
@@ -155,8 +162,10 @@ function UniformState() {
155
162
  this._frustum2DWidth = 0.0;
156
163
  this._eyeHeight = 0.0;
157
164
  this._eyeHeight2D = new Cartesian2();
165
+ this._eyeCartographic = new Cartesian3();
158
166
  this._eyeEllipsoidNormalEC = new Cartesian3();
159
167
  this._eyeEllipsoidCurvature = new Cartesian2();
168
+ this._eyeToEnu = new Matrix3();
160
169
  this._modelToEnu = new Matrix4();
161
170
  this._enuToModel = new Matrix4();
162
171
  this._pixelRatio = 1.0;
@@ -708,6 +717,19 @@ Object.defineProperties(UniformState.prototype, {
708
717
  },
709
718
  },
710
719
 
720
+ /**
721
+ * The geodetic longitude (<code>x</code>), latitude (<code>y</code>) in radians and
722
+ * height (<code>z</code>) in meters of the eye (camera).
723
+ * This is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
724
+ * @memberof UniformState.prototype
725
+ * @type {Cartesian3}
726
+ */
727
+ eyeCartographic: {
728
+ get: function () {
729
+ return this._eyeCartographic;
730
+ },
731
+ },
732
+
711
733
  /**
712
734
  * The height (<code>x</code>) and the height squared (<code>y</code>)
713
735
  * in meters of the eye (camera) above the 2D world plane. This uniform is only valid
@@ -744,9 +766,22 @@ Object.defineProperties(UniformState.prototype, {
744
766
  },
745
767
  },
746
768
 
769
+ /**
770
+ * A 3x3 rotation from eye coordinates to an east-north-up coordinate system
771
+ * centered at the position on the ellipsoid below the camera.
772
+ * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
773
+ * @memberof UniformState.prototype
774
+ * @type {Matrix3}
775
+ */
776
+ eyeToEnu: {
777
+ get: function () {
778
+ return this._eyeToEnu;
779
+ },
780
+ },
781
+
747
782
  /**
748
783
  * A transform from model coordinates to an east-north-up coordinate system
749
- * centered at the position on the ellipsoid below the camera
784
+ * centered at the position on the ellipsoid nearest to the camera.
750
785
  * @memberof UniformState.prototype
751
786
  * @type {Matrix4}
752
787
  */
@@ -1234,6 +1269,7 @@ function setInfiniteProjection(uniformState, matrix) {
1234
1269
 
1235
1270
  const surfacePositionScratch = new Cartesian3();
1236
1271
  const enuTransformScratch = new Matrix4();
1272
+ const enuRotationScratch = new Matrix3();
1237
1273
 
1238
1274
  function setCamera(uniformState, camera) {
1239
1275
  Cartesian3.clone(camera.positionWC, uniformState._cameraPosition);
@@ -1259,6 +1295,12 @@ function setCamera(uniformState, camera) {
1259
1295
  );
1260
1296
  } else {
1261
1297
  uniformState._eyeHeight = positionCartographic.height;
1298
+ uniformState._eyeCartographic = Cartesian3.fromElements(
1299
+ positionCartographic.longitude,
1300
+ positionCartographic.latitude,
1301
+ positionCartographic.height,
1302
+ uniformState._eyeCartographic,
1303
+ );
1262
1304
  uniformState._eyeEllipsoidNormalEC =
1263
1305
  ellipsoid.geodeticSurfaceNormalCartographic(
1264
1306
  positionCartographic,
@@ -1300,6 +1342,17 @@ function setCamera(uniformState, camera) {
1300
1342
  uniformState._modelToEnu,
1301
1343
  );
1302
1344
 
1345
+ const enuToWorldRotation = Matrix4.getRotation(
1346
+ enuToWorld,
1347
+ enuRotationScratch,
1348
+ );
1349
+ const enuToView = Matrix3.multiply(
1350
+ uniformState._viewRotation,
1351
+ enuToWorldRotation,
1352
+ enuRotationScratch,
1353
+ );
1354
+ uniformState._eyeToEnu = Matrix3.transpose(enuToView, uniformState._eyeToEnu);
1355
+
1303
1356
  if (
1304
1357
  !CesiumMath.equalsEpsilon(
1305
1358
  ellipsoid._radii.x,
@@ -645,7 +645,6 @@ VertexArray.fromGeometry = function (options) {
645
645
  }
646
646
 
647
647
  let attrProps = {};
648
- vertexBuffer = undefined;
649
648
  if (defined(attribute.values)) {
650
649
  vertexBuffer = Buffer.createVertexBuffer({
651
650
  context: context,
@@ -325,11 +325,6 @@ function ArcGisMapServerImageryProvider(options) {
325
325
  this._credit = options.credit;
326
326
  this._tileCredits = undefined;
327
327
 
328
- let credit = options.credit;
329
- if (typeof credit === "string") {
330
- credit = new Credit(credit);
331
- }
332
-
333
328
  /**
334
329
  * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
335
330
  * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "AAPTaNEKX8S_W5tHpwdW7Txp1uA..bCHyKIo32UDZUn0ep6bzo_JLzQdslNSJ9HpSru5K9nkNyUqvkKFceNFYUFPbtEEZPfCqpF_qVG3zdTZOzocx6Dnzy0e2LctUukYPVrG2GPAdcPN-M9nklag0M8cYMkSCHQOort_AeIxl8C7ORIX0KjE5Mrvbe0Rm3eC-YpZDiHp6PUyarwFpsRdcq1TvpcQqsqJQ3aoWdEIxnEjEZ6e6iZhte1i2oJgrZ8SxsSPaIbrjA4USgsQGeBjUAT1_V7gBCY6D";
7
+ "AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To";
8
8
  /**
9
9
  * Default options for accessing the ArcGIS image tile service.
10
10
  *
@@ -706,8 +706,9 @@ Object.defineProperties(Billboard.prototype, {
706
706
  },
707
707
 
708
708
  /**
709
- * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
709
+ * The aligned axis is the direction vector that the billboard up vector points towards.
710
710
  * The default is the zero vector, which means the billboard is aligned to the screen up vector.
711
+ * Note that only the zero vector (0,0,0) resets the alignment to screen up.
711
712
  * @memberof Billboard.prototype
712
713
  * @type {Cartesian3}
713
714
  * @example
@@ -1033,8 +1033,9 @@ function writeCompressedAttrib1(
1033
1033
  billboard,
1034
1034
  ) {
1035
1035
  const writer = vafWriters[attributeLocations.compressedAttribute1];
1036
- const alignedAxis = billboard.alignedAxis;
1036
+ let alignedAxis = billboard.alignedAxis;
1037
1037
  if (!Cartesian3.equals(alignedAxis, Cartesian3.ZERO)) {
1038
+ alignedAxis = Cartesian3.normalize(alignedAxis, new Cartesian3());
1038
1039
  billboardCollection._shaderAlignedAxis = true;
1039
1040
  }
1040
1041
 
@@ -1096,12 +1097,15 @@ function writeCompressedAttrib2(
1096
1097
  ? billboard.getPickId(frameState.context).color
1097
1098
  : Color.WHITE;
1098
1099
  const sizeInMeters = billboard.sizeInMeters ? 1.0 : 0.0;
1100
+ const rawAxis = billboard.alignedAxis;
1101
+ const normalizedAxis = !Cartesian3.equals(rawAxis, Cartesian3.ZERO)
1102
+ ? Cartesian3.normalize(rawAxis, new Cartesian3())
1103
+ : rawAxis;
1099
1104
  const validAlignedAxis =
1100
- Math.abs(Cartesian3.magnitudeSquared(billboard.alignedAxis) - 1.0) <
1105
+ Math.abs(Cartesian3.magnitudeSquared(normalizedAxis) - 1.0) <
1101
1106
  CesiumMath.EPSILON6
1102
1107
  ? 1.0
1103
1108
  : 0.0;
1104
-
1105
1109
  billboardCollection._allSizedInMeters =
1106
1110
  billboardCollection._allSizedInMeters && sizeInMeters === 1.0;
1107
1111
 
@@ -12,6 +12,7 @@ import BufferPointMaterial from "./BufferPointMaterial.js";
12
12
  /** @import ComponentDatatype from "../Core/ComponentDatatype.js"; */
13
13
  /** @import Matrix4 from "../Core/Matrix4.js"; */
14
14
  /** @import FrameState from "./FrameState.js"; */
15
+ /** @import { BufferPrimitiveCollectionOptions } from "./BufferPrimitiveCollection.js"; */
15
16
 
16
17
  /**
17
18
  * @typedef {object} BufferPointOptions
@@ -91,17 +92,13 @@ class BufferPointCollection extends BufferPrimitiveCollection {
91
92
  // COLLECTION LIFECYCLE
92
93
 
93
94
  /**
94
- * @param {BufferPointCollection} collection
95
+ * @param {BufferPrimitiveCollectionOptions} [options]
95
96
  * @returns {BufferPointCollection}
96
97
  * @override
97
98
  * @ignore
98
99
  */
99
- static _cloneEmpty(collection) {
100
- return new BufferPointCollection({
101
- primitiveCountMax: collection.primitiveCountMax,
102
- positionDatatype: collection.positionDatatype,
103
- positionNormalized: collection.positionNormalized,
104
- });
100
+ _cloneEmpty(options = Frozen.EMPTY_OBJECT) {
101
+ return new BufferPointCollection(this._cloneEmptyBaseArgs(options));
105
102
  }
106
103
 
107
104
  /////////////////////////////////////////////////////////////////////////////
@@ -14,6 +14,7 @@ import BufferPolygonMaterial from "./BufferPolygonMaterial.js";
14
14
  /** @import { TypedArray } from "../Core/globalTypes.js"; */
15
15
  /** @import Matrix4 from "../Core/Matrix4.js"; */
16
16
  /** @import FrameState from "./FrameState.js" */
17
+ /** @import HeightReference from "./HeightReference.js"; */
17
18
  /** @import ComponentDatatype from "../Core/ComponentDatatype.js"; */
18
19
 
19
20
  const { ERR_CAPACITY } = BufferPrimitiveCollection.Error;
@@ -31,6 +32,29 @@ const { ERR_CAPACITY } = BufferPrimitiveCollection.Error;
31
32
  * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
32
33
  */
33
34
 
35
+ /**
36
+ * @typedef {object} BufferPolygonCollectionOptions
37
+ * @property {number} [primitiveCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY] Maximum number of polygons.
38
+ * @property {number} [vertexCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY] Maximum number of vertices.
39
+ * @property {number} [holeCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY] Maximum number of holes.
40
+ * @property {number} [triangleCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY] Maximum number of triangles.
41
+ * @property {ComponentDatatype} [positionDatatype=ComponentDatatype.DOUBLE] The component datatype used to store position values.
42
+ * @property {boolean} [positionNormalized=false] When <code>true</code>, integer position values are treated as normalized,
43
+ * where the full integer range maps to [-1, 1] (signed) or [0, 1] (unsigned). Only relevant for integer position datatypes
44
+ * (BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT).
45
+ * @property {boolean} [show=true]
46
+ * @property {boolean} [allowPicking=true] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
47
+ * @property {BoundingSphere} [boundingVolume] Bounding volume, in world space, for the collection. When
48
+ * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When
49
+ * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume
50
+ * manually, and updating it only as needed, will improve performance for larger dynamic collections.
51
+ * @property {boolean} [debugShowBoundingVolume=false]
52
+ * @property {BlendOption} [blendOption=BlendOption.TRANSLUCENT]
53
+ * @property {HeightReference} [heightReference=HeightReference.NONE] When set to a clamping value, the
54
+ * collection is draped onto terrain and/or 3D Tiles, rather than drawn as geometry of its own.
55
+ * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
56
+ */
57
+
34
58
  /**
35
59
  * Collection of polygons held in ArrayBuffer storage for performance and memory optimization.
36
60
  *
@@ -76,21 +100,7 @@ const { ERR_CAPACITY } = BufferPrimitiveCollection.Error;
76
100
  */
77
101
  class BufferPolygonCollection extends BufferPrimitiveCollection {
78
102
  /**
79
- * @param {object} options
80
- * @param {number} [options.primitiveCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
81
- * @param {number} [options.vertexCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
82
- * @param {number} [options.holeCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
83
- * @param {number} [options.triangleCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
84
- * @param {ComponentDatatype} [options.positionDatatype=ComponentDatatype.DOUBLE]
85
- * @param {boolean} [options.positionNormalized=false]
86
- * @param {boolean} [options.show=true]
87
- * @param {boolean} [options.allowPicking=true] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
88
- * @param {BoundingSphere} [options.boundingVolume] Bounding volume, in world space, for the collection. When
89
- * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When
90
- * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume
91
- * manually, and updating it only as needed, will improve performance for larger dynamic collections.
92
- * @param {boolean} [options.debugShowBoundingVolume=false]
93
- * @param {BlendOption} [options.blendOption=BlendOption.TRANSLUCENT]
103
+ * @param {BufferPolygonCollectionOptions} [options]
94
104
  */
95
105
  constructor(options = Frozen.EMPTY_OBJECT) {
96
106
  super(options);
@@ -193,10 +203,16 @@ class BufferPolygonCollection extends BufferPrimitiveCollection {
193
203
  *
194
204
  * @param {BufferPolygonCollection} collection
195
205
  * @param {BufferPolygonCollection} result
206
+ * @param {function(BufferPolygon, number): boolean} [predicate] When provided, only polygons for which this returns <code>true</code> are copied. Surviving polygons are compacted into contiguous indices.
196
207
  * @returns {BufferPolygonCollection}
197
208
  */
198
- static clone(collection, result) {
199
- super.clone(collection, result);
209
+ static clone(collection, result, predicate) {
210
+ super.clone(collection, result, predicate);
211
+
212
+ // Base class's filtered clone uses PrimitiveClass.clone, which handles holes and triangles, so just return the result.
213
+ if (defined(predicate)) {
214
+ return result;
215
+ }
200
216
 
201
217
  //>>includeStart('debug', pragmas.debug);
202
218
  assert(collection.holeCount <= result.holeCountMax, ERR_CAPACITY);
@@ -222,19 +238,33 @@ class BufferPolygonCollection extends BufferPrimitiveCollection {
222
238
  }
223
239
 
224
240
  /**
225
- * @param {BufferPolygonCollection} collection
241
+ * Returns a copy of the given collection, overriding any constructor options
242
+ * provided. Omitted options are inherited from the source collection. Any
243
+ * resized buffers must be large enough to hold every polygon.
244
+ *
245
+ * @param {BufferPolygonCollection} collection Source collection to copy.
246
+ * @param {BufferPolygonCollectionOptions} [options] Constructor options to override. Omitted options are inherited from the source collection.
247
+ * @param {function(BufferPolygon, number): boolean} [predicate] When provided, only polygons for which this returns <code>true</code> are copied. Surviving polygons are compacted into contiguous indices.
248
+ * @returns {BufferPolygonCollection}
249
+ * @override
250
+ */
251
+ static fromCollection(collection, options, predicate) {
252
+ return /** @type {BufferPolygonCollection} */ (
253
+ super.fromCollection(collection, options, predicate)
254
+ );
255
+ }
256
+
257
+ /**
258
+ * @param {BufferPolygonCollectionOptions} [options]
226
259
  * @returns {BufferPolygonCollection}
227
260
  * @override
228
261
  * @ignore
229
262
  */
230
- static _cloneEmpty(collection) {
263
+ _cloneEmpty(options = Frozen.EMPTY_OBJECT) {
231
264
  return new BufferPolygonCollection({
232
- primitiveCountMax: collection.primitiveCountMax,
233
- vertexCountMax: collection.vertexCountMax,
234
- holeCountMax: collection.holeCountMax,
235
- triangleCountMax: collection.triangleCountMax,
236
- positionDatatype: collection.positionDatatype,
237
- positionNormalized: collection.positionNormalized,
265
+ holeCountMax: this.holeCountMax,
266
+ triangleCountMax: this.triangleCountMax,
267
+ ...this._cloneEmptyBaseArgs(options),
238
268
  });
239
269
  }
240
270
 
@@ -305,8 +335,7 @@ class BufferPolygonCollection extends BufferPrimitiveCollection {
305
335
  update(frameState) {
306
336
  super.update(frameState);
307
337
 
308
- const passes = frameState.passes;
309
- if (this.show && (passes.render || passes.pick)) {
338
+ if (this._isRendered(frameState)) {
310
339
  this._renderContext = renderPolygons(
311
340
  this,
312
341
  frameState,