@cesium/engine 26.1.0 → 26.2.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 (384) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +586 -480
  2. package/Build/Workers/chunk-27FWRTJI.js +454 -0
  3. package/Build/Workers/chunk-2H5264K7.js +1284 -0
  4. package/Build/Workers/chunk-2H73KDBM.js +511 -0
  5. package/Build/Workers/chunk-2RGJPWQX.js +1284 -0
  6. package/Build/Workers/chunk-2Z4ZLVOD.js +352 -0
  7. package/Build/Workers/chunk-2ZKH2QZB.js +387 -0
  8. package/Build/Workers/chunk-36NI5E6W.js +3820 -0
  9. package/Build/Workers/chunk-37SW7SYS.js +778 -0
  10. package/Build/Workers/chunk-3GHVJ3SO.js +455 -0
  11. package/Build/Workers/chunk-3LB4UVPU.js +387 -0
  12. package/Build/Workers/chunk-3PONLKEL.js +778 -0
  13. package/Build/Workers/chunk-3PSS3T43.js +102 -0
  14. package/Build/Workers/chunk-3QR662HH.js +3820 -0
  15. package/Build/Workers/chunk-3SX2WYSO.js +973 -0
  16. package/Build/Workers/chunk-3UDN6LYX.js +476 -0
  17. package/Build/Workers/chunk-47MCBSXI.js +9237 -0
  18. package/Build/Workers/chunk-4E626OCE.js +1067 -0
  19. package/Build/Workers/chunk-4NW2MJKH.js +455 -0
  20. package/Build/Workers/chunk-52YK5BSN.js +198 -0
  21. package/Build/Workers/chunk-5RNAQZK6.js +9234 -0
  22. package/Build/Workers/chunk-5YPQBFRD.js +519 -0
  23. package/Build/Workers/chunk-6FHT43QR.js +140 -0
  24. package/Build/Workers/chunk-6FZDPMTO.js +455 -0
  25. package/Build/Workers/chunk-6R5X2GUA.js +1284 -0
  26. package/Build/Workers/chunk-7A2OGDHT.js +305 -0
  27. package/Build/Workers/chunk-7CGEQUM2.js +305 -0
  28. package/Build/Workers/chunk-7I325HV6.js +1344 -0
  29. package/Build/Workers/chunk-7MM3N2VE.js +1067 -0
  30. package/Build/Workers/chunk-7TKLTCZW.js +219 -0
  31. package/Build/Workers/chunk-7UUKBDH6.js +1054 -0
  32. package/Build/Workers/chunk-7W6DUHAB.js +693 -0
  33. package/Build/Workers/chunk-7XM5JK5F.js +162 -0
  34. package/Build/Workers/chunk-7YG3ND3P.js +454 -0
  35. package/Build/Workers/chunk-A62YI6S6.js +305 -0
  36. package/Build/Workers/chunk-A7TTWVTF.js +2719 -0
  37. package/Build/Workers/chunk-ACTVJHSP.js +519 -0
  38. package/Build/Workers/chunk-ADX3CBKD.js +9234 -0
  39. package/Build/Workers/chunk-AF7DTMJ7.js +398 -0
  40. package/Build/Workers/chunk-AJSFRY4U.js +1344 -0
  41. package/Build/Workers/chunk-ARZICEEP.js +301 -0
  42. package/Build/Workers/chunk-B3QHNA4A.js +147 -0
  43. package/Build/Workers/chunk-BKPQFCXH.js +511 -0
  44. package/Build/Workers/chunk-BSPCI2LO.js +959 -0
  45. package/Build/Workers/chunk-BUJWSX5S.js +301 -0
  46. package/Build/Workers/chunk-C7QDUNI3.js +138 -0
  47. package/Build/Workers/chunk-CIV5DJOQ.js +778 -0
  48. package/Build/Workers/chunk-CQNFIAZU.js +56 -0
  49. package/Build/Workers/chunk-CRCGE4J4.js +9237 -0
  50. package/Build/Workers/chunk-CUTRKXUQ.js +288 -0
  51. package/Build/Workers/chunk-D6AY775A.js +3201 -0
  52. package/Build/Workers/chunk-DSGLDRTI.js +278 -0
  53. package/Build/Workers/chunk-DZBQUULR.js +138 -0
  54. package/Build/Workers/chunk-DZUFEE4L.js +140 -0
  55. package/Build/Workers/chunk-E2NKV5YT.js +3820 -0
  56. package/Build/Workers/chunk-EB3Y5P3A.js +368 -0
  57. package/Build/Workers/chunk-ELE6SC2C.js +837 -0
  58. package/Build/Workers/chunk-EOWDZN5S.js +288 -0
  59. package/Build/Workers/chunk-ERKUET22.js +3201 -0
  60. package/Build/Workers/chunk-EZGQPOIG.js +162 -0
  61. package/Build/Workers/chunk-F2IMBMZY.js +241 -0
  62. package/Build/Workers/chunk-F4CSNRZO.js +219 -0
  63. package/Build/Workers/chunk-FBP4DUQJ.js +693 -0
  64. package/Build/Workers/chunk-FJWZMGOQ.js +1992 -0
  65. package/Build/Workers/chunk-FQ42MT7M.js +58 -0
  66. package/Build/Workers/chunk-FU4BGABC.js +398 -0
  67. package/Build/Workers/chunk-FX3VEAIU.js +2719 -0
  68. package/Build/Workers/chunk-GGNWQWSB.js +301 -0
  69. package/Build/Workers/chunk-GHXVQVUM.js +1344 -0
  70. package/Build/Workers/chunk-GNKXEN4C.js +682 -0
  71. package/Build/Workers/chunk-GVA7XQI2.js +368 -0
  72. package/Build/Workers/chunk-GXDHRC4J.js +1344 -0
  73. package/Build/Workers/chunk-GYSYP6PC.js +1067 -0
  74. package/Build/Workers/chunk-H2WCFXLP.js +241 -0
  75. package/Build/Workers/chunk-HDL4HOXZ.js +778 -0
  76. package/Build/Workers/chunk-HLW2ZRVK.js +368 -0
  77. package/Build/Workers/chunk-HT6FASOT.js +973 -0
  78. package/Build/Workers/chunk-I74ZH5LK.js +959 -0
  79. package/Build/Workers/chunk-IDVHUDZT.js +352 -0
  80. package/Build/Workers/chunk-IJZJMIUY.js +789 -0
  81. package/Build/Workers/chunk-IMBVP57H.js +44 -0
  82. package/Build/Workers/chunk-IOO7Z2AV.js +57 -0
  83. package/Build/Workers/chunk-IUIFLOYO.js +44 -0
  84. package/Build/Workers/chunk-J73T2VOY.js +171 -0
  85. package/Build/Workers/chunk-JALGQYDY.js +288 -0
  86. package/Build/Workers/chunk-JXYLJCTC.js +124 -0
  87. package/Build/Workers/chunk-K27QOAW6.js +97 -0
  88. package/Build/Workers/chunk-KMV25A63.js +789 -0
  89. package/Build/Workers/chunk-KP5QD7WU.js +693 -0
  90. package/Build/Workers/chunk-KZWFWJML.js +2719 -0
  91. package/Build/Workers/chunk-LCXRRALY.js +387 -0
  92. package/Build/Workers/chunk-LDRQSYBN.js +1800 -0
  93. package/Build/Workers/chunk-M4JZ6TSZ.js +959 -0
  94. package/Build/Workers/chunk-M6QKXVAU.js +1054 -0
  95. package/Build/Workers/chunk-MAAHFYPC.js +198 -0
  96. package/Build/Workers/chunk-MCJDRDJQ.js +102 -0
  97. package/Build/Workers/chunk-MEENMEAH.js +198 -0
  98. package/Build/Workers/chunk-NAWU5RF4.js +162 -0
  99. package/Build/Workers/chunk-NCL22ZUX.js +56 -0
  100. package/Build/Workers/chunk-NEFDMMLY.js +241 -0
  101. package/Build/Workers/chunk-NJVBJG63.js +124 -0
  102. package/Build/Workers/chunk-NLLCQBX3.js +73 -0
  103. package/Build/Workers/chunk-NSKZ6SBK.js +1483 -0
  104. package/Build/Workers/chunk-NXGQBQWE.js +837 -0
  105. package/Build/Workers/chunk-O3DKEX7Q.js +352 -0
  106. package/Build/Workers/chunk-O3XFXGPZ.js +476 -0
  107. package/Build/Workers/chunk-OA6MYL2C.js +837 -0
  108. package/Build/Workers/chunk-OHP4ELS7.js +198 -0
  109. package/Build/Workers/chunk-OZGPS7FB.js +138 -0
  110. package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
  111. package/Build/Workers/chunk-PD4GK4EM.js +57 -0
  112. package/Build/Workers/chunk-PEDU33QG.js +2342 -0
  113. package/Build/Workers/chunk-PRWUMCXF.js +682 -0
  114. package/Build/Workers/chunk-PVTSNNVI.js +288 -0
  115. package/Build/Workers/chunk-QFSSCLLZ.js +973 -0
  116. package/Build/Workers/chunk-QHPZH22L.js +241 -0
  117. package/Build/Workers/chunk-QIZDWZK6.js +301 -0
  118. package/Build/Workers/chunk-QV6DG2YX.js +1483 -0
  119. package/Build/Workers/chunk-R4K7EHOU.js +171 -0
  120. package/Build/Workers/chunk-R7JGHDD6.js +789 -0
  121. package/Build/Workers/chunk-RASQEYD4.js +1483 -0
  122. package/Build/Workers/chunk-RW6ITX7Q.js +3820 -0
  123. package/Build/Workers/chunk-RYSQVJR6.js +398 -0
  124. package/Build/Workers/chunk-S6RJU5NM.js +1054 -0
  125. package/Build/Workers/chunk-SA2A2AN5.js +2342 -0
  126. package/Build/Workers/chunk-SDFHDNS4.js +147 -0
  127. package/Build/Workers/chunk-SJYSIOEM.js +414 -0
  128. package/Build/Workers/chunk-SMTGMFBL.js +97 -0
  129. package/Build/Workers/chunk-SXSP3JHS.js +38 -0
  130. package/Build/Workers/chunk-TN35HP5B.js +1067 -0
  131. package/Build/Workers/chunk-TNWKJNUZ.js +454 -0
  132. package/Build/Workers/chunk-TOAF47AQ.js +102 -0
  133. package/Build/Workers/chunk-TQ4QCOXT.js +2719 -0
  134. package/Build/Workers/chunk-TSDSILQB.js +124 -0
  135. package/Build/Workers/chunk-U5LV3F3Z.js +1054 -0
  136. package/Build/Workers/chunk-UAZUP4I5.js +1992 -0
  137. package/Build/Workers/chunk-UF46SZEZ.js +789 -0
  138. package/Build/Workers/chunk-UNRTMCET.js +398 -0
  139. package/Build/Workers/chunk-UTB7U3O6.js +1992 -0
  140. package/Build/Workers/chunk-V46YGZE6.js +352 -0
  141. package/Build/Workers/chunk-VDGOCROW.js +57 -0
  142. package/Build/Workers/chunk-VFWSSBPT.js +511 -0
  143. package/Build/Workers/chunk-VVYMXI3I.js +1284 -0
  144. package/Build/Workers/chunk-VXWHPYQM.js +837 -0
  145. package/Build/Workers/chunk-VXYUBRSB.js +219 -0
  146. package/Build/Workers/chunk-VZLDLEWI.js +387 -0
  147. package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
  148. package/Build/Workers/chunk-WN3F4CVG.js +3201 -0
  149. package/Build/Workers/chunk-WPRUWXGV.js +693 -0
  150. package/Build/Workers/chunk-WTO2ERBP.js +414 -0
  151. package/Build/Workers/chunk-WVHMDVG4.js +959 -0
  152. package/Build/Workers/chunk-XCBZVTIV.js +280 -0
  153. package/Build/Workers/chunk-XGA23TAX.js +73 -0
  154. package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
  155. package/Build/Workers/chunk-XQH66YJC.js +147 -0
  156. package/Build/Workers/chunk-XTA7BXJG.js +682 -0
  157. package/Build/Workers/chunk-XTIDAFRS.js +476 -0
  158. package/Build/Workers/chunk-XUEDWBUD.js +682 -0
  159. package/Build/Workers/chunk-XYFLRH3H.js +124 -0
  160. package/Build/Workers/chunk-Y7JRTRTO.js +305 -0
  161. package/Build/Workers/chunk-Y7QSMDCJ.js +352 -0
  162. package/Build/Workers/chunk-YCB5TYTR.js +1483 -0
  163. package/Build/Workers/chunk-YEYOSTJX.js +219 -0
  164. package/Build/Workers/chunk-YGFVAGYF.js +630 -0
  165. package/Build/Workers/chunk-YIIACKQO.js +368 -0
  166. package/Build/Workers/chunk-YJGSP6PE.js +511 -0
  167. package/Build/Workers/chunk-Z4LR5EHE.js +454 -0
  168. package/Build/Workers/chunk-Z66EVE2A.js +44 -0
  169. package/Build/Workers/chunk-ZHIHHHTB.js +414 -0
  170. package/Build/Workers/chunk-ZNWHFSLE.js +171 -0
  171. package/Build/Workers/chunk-ZQLZG4IN.js +2342 -0
  172. package/Build/Workers/chunk-ZRTSMUZ2.js +414 -0
  173. package/Build/Workers/chunk-ZZUVT5BM.js +476 -0
  174. package/Build/Workers/combineGeometry.js +16 -16
  175. package/Build/Workers/createBoxGeometry.js +10 -10
  176. package/Build/Workers/createBoxOutlineGeometry.js +8 -8
  177. package/Build/Workers/createCircleGeometry.js +18 -18
  178. package/Build/Workers/createCircleOutlineGeometry.js +11 -11
  179. package/Build/Workers/createCoplanarPolygonGeometry.js +27 -27
  180. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +23 -23
  181. package/Build/Workers/createCorridorGeometry.js +23 -25
  182. package/Build/Workers/createCorridorOutlineGeometry.js +21 -23
  183. package/Build/Workers/createCylinderGeometry.js +12 -12
  184. package/Build/Workers/createCylinderOutlineGeometry.js +10 -10
  185. package/Build/Workers/createEllipseGeometry.js +18 -18
  186. package/Build/Workers/createEllipseOutlineGeometry.js +11 -11
  187. package/Build/Workers/createEllipsoidGeometry.js +11 -11
  188. package/Build/Workers/createEllipsoidOutlineGeometry.js +10 -10
  189. package/Build/Workers/createFrustumGeometry.js +11 -11
  190. package/Build/Workers/createFrustumOutlineGeometry.js +11 -11
  191. package/Build/Workers/createGeometry.js +16 -16
  192. package/Build/Workers/createGroundPolylineGeometry.js +16 -16
  193. package/Build/Workers/createPlaneGeometry.js +9 -9
  194. package/Build/Workers/createPlaneOutlineGeometry.js +8 -8
  195. package/Build/Workers/createPolygonGeometry.js +25 -25
  196. package/Build/Workers/createPolygonOutlineGeometry.js +22 -22
  197. package/Build/Workers/createPolylineGeometry.js +18 -18
  198. package/Build/Workers/createPolylineVolumeGeometry.js +24 -24
  199. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +20 -20
  200. package/Build/Workers/createRectangleGeometry.js +19 -19
  201. package/Build/Workers/createRectangleOutlineGeometry.js +13 -13
  202. package/Build/Workers/createSimplePolylineGeometry.js +16 -16
  203. package/Build/Workers/createSphereGeometry.js +11 -11
  204. package/Build/Workers/createSphereOutlineGeometry.js +10 -10
  205. package/Build/Workers/createVectorTileClampedPolylines.js +7 -7
  206. package/Build/Workers/createVectorTileGeometries.js +15 -15
  207. package/Build/Workers/createVectorTilePoints.js +6 -6
  208. package/Build/Workers/createVectorTilePolygons.js +14 -14
  209. package/Build/Workers/createVectorTilePolylines.js +7 -7
  210. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +17 -17
  211. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +14 -14
  212. package/Build/Workers/createVerticesFromHeightmap.js +14 -14
  213. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +12 -12
  214. package/Build/Workers/createWallGeometry.js +17 -17
  215. package/Build/Workers/createWallOutlineGeometry.js +17 -17
  216. package/Build/Workers/decodeDraco.js +2 -2
  217. package/Build/Workers/decodeI3S.js +5 -5
  218. package/Build/Workers/incrementallyBuildTerrainPicker.js +4 -4
  219. package/Build/Workers/upsampleQuantizedTerrainMesh.js +14 -14
  220. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +17 -17
  221. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
  222. package/Source/Core/BoundingSphere.js +0 -3
  223. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
  224. package/Source/Core/CoplanarPolygonGeometry.js +2 -2
  225. package/Source/Core/CorridorGeometry.js +2 -4
  226. package/Source/Core/CorridorOutlineGeometry.js +1 -3
  227. package/Source/Core/EarthOrientationParameters.js +2 -2
  228. package/Source/Core/EllipseGeometryLibrary.js +2 -2
  229. package/Source/Core/EllipsoidGeodesic.js +3 -3
  230. package/Source/Core/EllipsoidRhumbLine.js +1 -1
  231. package/Source/Core/GroundPolylineGeometry.js +2 -2
  232. package/Source/Core/Heap.js +1 -1
  233. package/Source/Core/HermitePolynomialApproximation.js +215 -179
  234. package/Source/Core/InterpolationAlgorithm.js +1 -0
  235. package/Source/Core/Ion.js +1 -1
  236. package/Source/Core/JulianDate.js +1 -1
  237. package/Source/Core/LagrangePolynomialApproximation.js +55 -52
  238. package/Source/Core/LinearApproximation.js +69 -66
  239. package/Source/Core/Math.js +59 -0
  240. package/Source/Core/Matrix2.js +2 -2
  241. package/Source/Core/Matrix3.js +2 -2
  242. package/Source/Core/OrthographicFrustum.js +1 -1
  243. package/Source/Core/PerspectiveFrustum.js +1 -1
  244. package/Source/Core/PolygonGeometry.js +2 -2
  245. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  246. package/Source/Core/PolygonOutlineGeometry.js +1 -1
  247. package/Source/Core/PolylineGeometry.js +1 -1
  248. package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
  249. package/Source/Core/Rectangle.js +7 -1
  250. package/Source/Core/RectangleOutlineGeometry.js +1 -1
  251. package/Source/Core/SimplePolylineGeometry.js +1 -1
  252. package/Source/Core/TerrainEncoding.js +2 -2
  253. package/Source/Core/TerrainPicker.js +179 -168
  254. package/Source/Core/TimeIntervalCollection.js +1 -3
  255. package/Source/Core/Tipsify.js +1 -1
  256. package/Source/Core/Transforms.js +5 -1
  257. package/Source/Core/VectorPipeline.js +1117 -0
  258. package/Source/Core/VectorProvider.js +429 -0
  259. package/Source/Core/WallOutlineGeometry.js +1 -1
  260. package/Source/Core/getTimestamp.js +4 -2
  261. package/Source/DataSources/CompositeEntityCollection.js +0 -1
  262. package/Source/DataSources/CzmlDataSource.js +2 -0
  263. package/Source/DataSources/DataSourceDisplay.js +1 -1
  264. package/Source/DataSources/GeoJsonDataSource.js +0 -1
  265. package/Source/DataSources/GeometryVisualizer.js +1 -1
  266. package/Source/DataSources/KmlDataSource.js +1 -2
  267. package/Source/DataSources/PolylineVisualizer.js +1 -1
  268. package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
  269. package/Source/Renderer/AutomaticUniforms.js +23 -0
  270. package/Source/Renderer/Context.js +9 -3
  271. package/Source/Renderer/DrawCommand.js +22 -0
  272. package/Source/Renderer/Framebuffer.js +4 -0
  273. package/Source/Renderer/Pass.js +11 -10
  274. package/Source/Renderer/Texture.js +11 -0
  275. package/Source/Renderer/UniformState.js +7 -0
  276. package/Source/Renderer/VertexArray.js +0 -1
  277. package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
  278. package/Source/Scene/ArcGisMapService.js +1 -1
  279. package/Source/Scene/Billboard.js +2 -1
  280. package/Source/Scene/BillboardCollection.js +7 -3
  281. package/Source/Scene/BufferPrimitiveCollection.js +27 -5
  282. package/Source/Scene/Camera.js +71 -5
  283. package/Source/Scene/Cesium3DTileset.js +1 -1
  284. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  285. package/Source/Scene/Controllers/Controller.js +63 -0
  286. package/Source/Scene/Controllers/ControllerHost.js +78 -0
  287. package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
  288. package/Source/Scene/Controllers/MouseButton.js +32 -0
  289. package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
  290. package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
  291. package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
  292. package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
  293. package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
  294. package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
  295. package/Source/Scene/DerivedCommand.js +94 -0
  296. package/Source/Scene/EdgeFramebuffer.js +1 -5
  297. package/Source/Scene/FrameState.js +17 -0
  298. package/Source/Scene/Globe.js +20 -0
  299. package/Source/Scene/GlobeDepth.js +27 -1
  300. package/Source/Scene/GlobeSurfaceShaderSet.js +12 -2
  301. package/Source/Scene/GlobeSurfaceTile.js +48 -10
  302. package/Source/Scene/GlobeSurfaceTileProvider.js +121 -3
  303. package/Source/Scene/GltfLoader.js +32 -3
  304. package/Source/Scene/GltfSpzLoader.js +1 -1
  305. package/Source/Scene/GltfVertexBufferLoader.js +6 -3
  306. package/Source/Scene/I3SDataProvider.js +1 -1
  307. package/Source/Scene/I3SLayer.js +1 -1
  308. package/Source/Scene/I3SNode.js +2 -2
  309. package/Source/Scene/ImageryLayerCollection.js +188 -4
  310. package/Source/Scene/IonImageryProvider.js +1 -5
  311. package/Source/Scene/Label.js +4 -4
  312. package/Source/Scene/LabelCollection.js +1 -1
  313. package/Source/Scene/MVTDataProvider.js +2 -0
  314. package/Source/Scene/Model/B3dmLoader.js +1 -2
  315. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
  316. package/Source/Scene/Model/I3dmLoader.js +1 -1
  317. package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
  318. package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
  319. package/Source/Scene/Model/Model.js +8 -10
  320. package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
  321. package/Source/Scene/Model/ModelDrawCommand.js +160 -16
  322. package/Source/Scene/Model/ModelDrawCommands.js +4 -0
  323. package/Source/Scene/Model/ModelSceneGraph.js +21 -0
  324. package/Source/Scene/Model/PickingPipelineStage.js +29 -0
  325. package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
  326. package/Source/Scene/ModelComponents.js +71 -0
  327. package/Source/Scene/Picking.js +16 -5
  328. package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
  329. package/Source/Scene/PntsParser.js +0 -1
  330. package/Source/Scene/PolylineCollection.js +1 -1
  331. package/Source/Scene/PostProcessStage.js +4 -2
  332. package/Source/Scene/ResourceCache.js +7 -4
  333. package/Source/Scene/ResourceCacheKey.js +16 -13
  334. package/Source/Scene/Scene.js +202 -5
  335. package/Source/Scene/ScreenSpaceCameraController.js +1 -2
  336. package/Source/Scene/ShadowMap.js +9 -3
  337. package/Source/Scene/ShadowMapShader.js +50 -2
  338. package/Source/Scene/SnapFramebuffer.js +121 -0
  339. package/Source/Scene/Snapping.js +184 -0
  340. package/Source/Scene/TerrainFillMesh.js +3 -2
  341. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +1 -1
  342. package/Source/Scene/Vector3DTileContent.js +2 -3
  343. package/Source/Scene/VectorGltf3DTileContent.js +23 -3
  344. package/Source/Scene/View.js +10 -8
  345. package/Source/Scene/VoxelTraversal.js +1 -1
  346. package/Source/Scene/createElevationBandMaterial.js +1 -1
  347. package/Source/Scene/renderBufferPointCollection.js +1 -2
  348. package/Source/Scene/renderBufferPolygonCollection.js +1 -2
  349. package/Source/Scene/renderBufferPolylineCollection.js +1 -2
  350. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  351. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  352. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  353. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  354. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  355. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  356. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
  357. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
  358. package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
  359. package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
  360. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  361. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  362. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  363. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  364. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  365. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  366. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  367. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  368. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  369. package/Source/Shaders/GlobeFS.glsl +10 -5
  370. package/Source/Shaders/GlobeFS.js +9 -5
  371. package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
  372. package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
  373. package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
  374. package/Source/Shaders/Model/MaterialStageFS.js +8 -2
  375. package/Source/Shaders/Model/ModelFS.glsl +105 -0
  376. package/Source/Shaders/Model/ModelFS.js +105 -0
  377. package/Source/Shaders/VectorCommon.glsl +178 -0
  378. package/Source/Shaders/VectorCommon.js +75 -0
  379. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  380. package/Source/ThirdParty/zip-module.wasm +0 -0
  381. package/Source/Widget/CesiumWidget.js +30 -0
  382. package/index.d.ts +770 -10
  383. package/index.js +177 -160
  384. package/package.json +1 -1
@@ -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
  */
@@ -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
+ "AAPTa7BPWL4PoZRFPJ2CM2YRclg..ub1vMOBXctC7ozMMKNnmx3ZwVTsDJAXo2GLomQ2CZjuOc2HLr1-CryeuRo9ZsV65cuZ9xN1yFKeLTu7Cxld7B97aI28os_NnuC9nvWde_l4G1DTApSHmhrVoZfKgO0bqOrsDfvvSgO-cdkUEvBASNX_4Lb9tB5fEY7lbYaWdOOWBXyZylR9il0-biB248V6HdDT1kgkSwz9esfKialRTLgxJx8AFM9is--UXK0CLvZn6JUU44PZSFuMyAT1_rgxsirsZ";
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
 
@@ -194,7 +194,6 @@ class BufferPrimitiveCollection {
194
194
 
195
195
  /**
196
196
  * @type {number}
197
- * @protected
198
197
  * @ignore
199
198
  */
200
199
  this._positionCountMax =
@@ -249,6 +248,13 @@ class BufferPrimitiveCollection {
249
248
  */
250
249
  this._dirtyBoundingVolume = false;
251
250
 
251
+ /**
252
+ * Monotonically increasing counter, bumped each time collection is marked "clean".
253
+ * @type {number}
254
+ * @ignore
255
+ */
256
+ this._version = 0;
257
+
252
258
  this._allocatePrimitiveBuffer();
253
259
  this._allocatePositionBuffer();
254
260
  this._allocateMaterialBuffer();
@@ -524,13 +530,14 @@ class BufferPrimitiveCollection {
524
530
  vertices,
525
531
  Cartesian3.ZERO,
526
532
  3,
527
- this.boundingVolume,
533
+ this._boundingVolume,
528
534
  );
529
535
  BoundingSphere.transform(
530
- this.boundingVolume,
531
- this.modelMatrix,
532
- this.boundingVolume,
536
+ this._boundingVolume,
537
+ this._modelMatrix,
538
+ this._boundingVolume,
533
539
  );
540
+
534
541
  this._dirtyBoundingVolume = false;
535
542
  }
536
543
 
@@ -660,6 +667,18 @@ class BufferPrimitiveCollection {
660
667
  }
661
668
  }
662
669
 
670
+ /**
671
+ * Marks all primitives 'clean', and updates version counter.
672
+ * @ignore
673
+ */
674
+ _makeClean() {
675
+ if (this._dirtyCount > 0) {
676
+ this._dirtyCount = 0;
677
+ this._dirtyOffset = 0;
678
+ this._version++;
679
+ }
680
+ }
681
+
663
682
  /**
664
683
  * Marks collection bounding volume as 'dirty', to be updated on next render,
665
684
  * if automatic bounding volume updates are enabled.
@@ -771,6 +790,9 @@ class BufferPrimitiveCollection {
771
790
  * @readonly
772
791
  */
773
792
  get boundingVolume() {
793
+ if (this._dirtyBoundingVolume) {
794
+ this._updateBoundingVolume();
795
+ }
774
796
  return this._boundingVolume;
775
797
  }
776
798
 
@@ -3,6 +3,7 @@ import Cartesian2 from "../Core/Cartesian2.js";
3
3
  import Cartesian3 from "../Core/Cartesian3.js";
4
4
  import Cartesian4 from "../Core/Cartesian4.js";
5
5
  import Cartographic from "../Core/Cartographic.js";
6
+ import Check from "../Core/Check.js";
6
7
  import Frozen from "../Core/Frozen.js";
7
8
  import defined from "../Core/defined.js";
8
9
  import DeveloperError from "../Core/DeveloperError.js";
@@ -2356,7 +2357,7 @@ const scratchLookAtHeadingPitchRangeQuaternion1 = new Quaternion();
2356
2357
  const scratchLookAtHeadingPitchRangeQuaternion2 = new Quaternion();
2357
2358
  const scratchHeadingPitchRangeMatrix3 = new Matrix3();
2358
2359
 
2359
- function offsetFromHeadingPitchRange(heading, pitch, range) {
2360
+ function offsetFromHeadingPitchRange(heading, pitch, range, result) {
2360
2361
  pitch = CesiumMath.clamp(
2361
2362
  pitch,
2362
2363
  -CesiumMath.PI_OVER_TWO,
@@ -2380,10 +2381,7 @@ function offsetFromHeadingPitchRange(heading, pitch, range) {
2380
2381
  scratchHeadingPitchRangeMatrix3,
2381
2382
  );
2382
2383
 
2383
- const offset = Cartesian3.clone(
2384
- Cartesian3.UNIT_X,
2385
- scratchLookAtHeadingPitchRangeOffset,
2386
- );
2384
+ const offset = Cartesian3.clone(Cartesian3.UNIT_X, result);
2387
2385
  Matrix3.multiplyByVector(rotMatrix, offset, offset);
2388
2386
  Cartesian3.negate(offset, offset);
2389
2387
  Cartesian3.multiplyByScalar(offset, range, offset);
@@ -2441,6 +2439,7 @@ Camera.prototype.lookAtTransform = function (transform, offset) {
2441
2439
  offset.heading,
2442
2440
  offset.pitch,
2443
2441
  offset.range,
2442
+ scratchLookAtHeadingPitchRangeOffset,
2444
2443
  );
2445
2444
  } else {
2446
2445
  cartesianOffset = offset;
@@ -2492,6 +2491,72 @@ Camera.prototype.lookAtTransform = function (transform, offset) {
2492
2491
  this._adjustOrthographicFrustum(true);
2493
2492
  };
2494
2493
 
2494
+ const scratchLookAtWorldPositionTransform = new Matrix4();
2495
+ const scratchLookAtWorldPositionDirection = new Cartesian3();
2496
+ const scratchLookAtWorldPositionWorldUp = new Cartesian3();
2497
+ const scratchLookAtWorldPositionRight = new Cartesian3();
2498
+
2499
+ /**
2500
+ * Sets the camera orientation to look at a target position in world coordinates. The camera's up vector will be oriented to the world up vector at the target position.
2501
+ * If the camera is at the target position, the camera will be oriented to the world up vector at the target position.
2502
+ * @param {Cartesian3} target The target position in world coordinates.
2503
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to use for determining the world up.
2504
+ */
2505
+ Camera.prototype.lookAtWorldPosition = function (
2506
+ target,
2507
+ ellipsoid = Ellipsoid.default,
2508
+ ) {
2509
+ //>>includeStart('debug', pragmas.debug);
2510
+ Check.typeOf.object("target", target);
2511
+ Check.typeOf.object("ellipsoid", ellipsoid);
2512
+ //>>includeEnd('debug');
2513
+
2514
+ const transform = Matrix4.clone(
2515
+ this._transform,
2516
+ scratchLookAtWorldPositionTransform,
2517
+ );
2518
+
2519
+ this._setTransform(Matrix4.IDENTITY);
2520
+
2521
+ // Get direction to look at target
2522
+ let direction = Cartesian3.subtract(
2523
+ target,
2524
+ this.positionWC,
2525
+ scratchLookAtWorldPositionDirection,
2526
+ );
2527
+
2528
+ // If the camera is at the target position, we can't look at it, but we should still continue to re-orient the camera to the world up vector at the target position.
2529
+ if (Cartesian3.magnitudeSquared(direction) < CesiumMath.EPSILON8) {
2530
+ direction = Cartesian3.clone(
2531
+ this.directionWC,
2532
+ scratchLookAtWorldPositionDirection,
2533
+ );
2534
+ }
2535
+
2536
+ direction = Cartesian3.normalize(direction, this.direction);
2537
+
2538
+ // Orient the camera to the world up vector at the target position
2539
+ const worldUp = ellipsoid.geodeticSurfaceNormal(
2540
+ target,
2541
+ scratchLookAtWorldPositionWorldUp,
2542
+ );
2543
+
2544
+ let right = Cartesian3.cross(
2545
+ direction,
2546
+ worldUp,
2547
+ scratchLookAtWorldPositionRight,
2548
+ );
2549
+ if (Cartesian3.magnitudeSquared(right) < CesiumMath.EPSILON8) {
2550
+ right = Cartesian3.clone(this.rightWC, scratchLookAtWorldPositionRight);
2551
+ }
2552
+ Cartesian3.normalize(right, this.right);
2553
+
2554
+ const up = Cartesian3.cross(right, direction, this.up);
2555
+ Cartesian3.normalize(up, this.up);
2556
+
2557
+ this._setTransform(transform);
2558
+ };
2559
+
2495
2560
  const viewRectangle3DCartographic1 = new Cartographic();
2496
2561
  const viewRectangle3DCartographic2 = new Cartographic();
2497
2562
  const viewRectangle3DNorthEast = new Cartesian3();
@@ -3621,6 +3686,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) {
3621
3686
  offset.heading,
3622
3687
  offset.pitch,
3623
3688
  offset.range,
3689
+ scratchflyToBoundingSphereDestination,
3624
3690
  );
3625
3691
  }
3626
3692
 
@@ -103,7 +103,7 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js";
103
103
  * @property {ClippingPlaneCollection} [clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
104
104
  * @property {ClippingPolygonCollection} [clippingPolygons] The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset.
105
105
  * @property {ClassificationType} [classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
106
- * @property {HeightReference} [heightReference] Sets the {@link HeightReference} for point features in vector tilesets.
106
+ * @property {HeightReference} [heightReference] Sets the {@link HeightReference} for features in vector tilesets.
107
107
  * @property {Scene} [scene] The {@link CesiumWidget#scene} that the tileset will be rendered in, required for tilesets that specify a {@link heightReference} value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles.
108
108
  * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.
109
109
  * @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
@@ -545,8 +545,8 @@ ClippingPlaneCollection.prototype.update = function (frameState) {
545
545
  }
546
546
  if (!this._multipleDirtyPlanes) {
547
547
  // partial updates possible
548
- let offsetX = 0;
549
- let offsetY = 0;
548
+ let offsetX;
549
+ let offsetY;
550
550
  if (useFloatTexture) {
551
551
  offsetY = Math.floor(dirtyIndex / clippingPlanesTexture.width);
552
552
  offsetX = Math.floor(dirtyIndex - offsetY * clippingPlanesTexture.width);
@@ -0,0 +1,63 @@
1
+ import DeveloperError from "../../Core/DeveloperError.js";
2
+
3
+ /**
4
+ * An interface for a camera controller that can be registered with the scene to handle input events, camera animations, and other interactions. Implementations of this interface are expected to be registered with the scene via a {@link ControllerHost}.
5
+ * This type describes an
6
+ * interface and is not intended to be instantiated directly.
7
+ * @class
8
+ * @abstract
9
+ * @see {@link HybridScreenSpacePanCameraController}
10
+ * @see {@link ScreenSpaceElevatorCameraController}
11
+ * @see {@link ScreenSpaceMapCameraController}
12
+ * @see {@link ScreenSpaceTiltOrbitCameraController}
13
+ */
14
+ class Controller {
15
+ /**
16
+ * Determines if the controller is enabled and should be updated by the host scene.
17
+ * @type {boolean}
18
+ */
19
+ get enabled() {
20
+ return DeveloperError.throwInstantiationError();
21
+ }
22
+ set enabled(value) {
23
+ DeveloperError.throwInstantiationError();
24
+ }
25
+
26
+ /**
27
+ * Invoked when the controller is added to the DOM. Implement <code>connectedCallback</code> to set up any DOM event listeners.
28
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
29
+ */
30
+ connectedCallback(element) {
31
+ DeveloperError.throwInstantiationError();
32
+ }
33
+
34
+ /**
35
+ * Invoked when the controller is removed from the DOM. Implement <code>disconnectedCallback</code> to tear down any DOM event listeners.
36
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
37
+ */
38
+ disconnectedCallback(element) {
39
+ DeveloperError.throwInstantiationError();
40
+ }
41
+
42
+ /**
43
+ * Invoked once per frame. Implement <code>update</code> to modify the camera or other parts of the scene.
44
+ * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/#updaterender-cycle-events|Update/Render Cycle Events}
45
+ * @param {Scene} scene
46
+ * @param {JulianDate} time The current simulation time.
47
+ */
48
+ update(scene, time) {
49
+ DeveloperError.throwInstantiationError();
50
+ }
51
+
52
+ /**
53
+ * Invoked when the controller is being updated the first time, immediately before <code>update</code> is called. Implement <code>firstUpdate</code> to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene.
54
+ * @see Controller#update
55
+ * @param {Scene} scene
56
+ * @param {JulianDate} time The current simulation time.
57
+ */
58
+ firstUpdate(scene, time) {
59
+ DeveloperError.throwInstantiationError();
60
+ }
61
+ }
62
+
63
+ export default Controller;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Collects an array of Controller objects that can be registered with the scene to handle input events, camera animations, and other interactions.
3
+ * @class
4
+ * @see {@link Controller}
5
+ * @see {@link Scene#controllerHost}
6
+ */
7
+ class ControllerHost {
8
+ /**
9
+ * Creates an instance of a <code>ControllerHost</code>. Typically, a <code>ControllerHost</code> is created by the Scene constructor and accessed via {@link Scene#controllerHost}.
10
+ * @see {@link Scene#controllerHost}
11
+ */
12
+ constructor() {
13
+ /**
14
+ * @type {Controller[]}
15
+ * @private
16
+ */
17
+ this._controllers = [];
18
+ this._needsUpdate = new Set();
19
+ }
20
+
21
+ /**
22
+ * The number of controllers registered to this host.
23
+ * @type {number}
24
+ * @readonly
25
+ */
26
+ get controllerCount() {
27
+ return this._controllers.length;
28
+ }
29
+
30
+ /**
31
+ * Registers a controller implementation with this host.
32
+ * @param {Controller} controller An implementation of the Controller interface to register with this host.
33
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
34
+ * @param {number} [priority=0] An index, less than or equal to the current count of registed controllers, that defines the precedence of the new controller relative to those previously registered. A priority of <code>0</code> would mean the new controller would apply its updates before any other controller. As subsequent controllers are updated, their effects are applied on top of any previous update effects. If omitted, the new controller becomes the highest priority, i.e., its updates are applied after all other controllers.
35
+ */
36
+ registerController(controller, element, priority) {
37
+ const index = priority ?? this.controllerCount;
38
+ this._controllers.splice(index, 0, controller);
39
+ this._needsUpdate.add(controller);
40
+ controller.connectedCallback(element);
41
+ }
42
+
43
+ /**
44
+ * Unregisters a controller implementation from this host.
45
+ * @param {Controller} controller An implementation of the Controller interface to unregister from this host.
46
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
47
+ */
48
+ unregisterController(controller, element) {
49
+ const controllers = this._controllers;
50
+ const index = controllers.indexOf(controller);
51
+ if (index !== -1) {
52
+ controllers.splice(index, 1);
53
+ controller.disconnectedCallback(element);
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Invoked once per frame by the host scene. Updates all registered controllers in order of their priority.
59
+ * @param {Scene} scene The host scene.
60
+ * @param {JulianDate} time The current simulation time.
61
+ */
62
+ update(scene, time) {
63
+ for (const controller of this._controllers) {
64
+ if (!controller.enabled) {
65
+ continue;
66
+ }
67
+
68
+ if (this._needsUpdate.has(controller)) {
69
+ controller.firstUpdate(scene, time);
70
+ this._needsUpdate.delete(controller);
71
+ }
72
+
73
+ controller.update(scene, time);
74
+ }
75
+ }
76
+ }
77
+
78
+ export default ControllerHost;
@@ -0,0 +1,106 @@
1
+ import ScreenSpaceElevatorCameraController from "./ScreenSpaceElevatorCameraController.js";
2
+ import ScreenSpaceMapCameraController from "./ScreenSpaceMapCameraController.js";
3
+ import Cartesian3 from "../../Core/Cartesian3.js";
4
+ import CesiumMath from "../../Core/Math.js";
5
+
6
+ /**
7
+ * A contextual camera controller that combines screenspace map panning and screenspace elevator panning. The controller automatically switches between the two based on the camera's angle relative to nadir. If the camera is looking mostly down (within angleThreshold of nadir), <code>ScreenSpaceMapCameraController</code> is used.
8
+ * If the camera is looking towards the horizon (beyond angleThreshold from nadir), the <code>ScreenSpaceElevatorCameraController</code> is used.
9
+ * @implements Controller
10
+ * @example
11
+ * viewer.scene.screenSpaceCameraController.enableInputs = false;
12
+ * viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
13
+ *
14
+ * const hybridController = new HybridScreenSpacePanCameraController();
15
+ * viewer.addController(hybridController);
16
+ */
17
+ class HybridScreenSpacePanCameraController {
18
+ constructor() {
19
+ this._elevatorController = new ScreenSpaceElevatorCameraController();
20
+ this._mapController = new ScreenSpaceMapCameraController();
21
+
22
+ this._enabled = true;
23
+ this._ellipsoidNormal = new Cartesian3();
24
+
25
+ /**
26
+ * The angle threshold in radians that determines which controller is used. If the camera is looking within this angle of nadir, the map controller is used. Otherwise, the elevator controller is used.
27
+ * @type {number}
28
+ * @default CesiumMath.toRadians(125)
29
+ */
30
+ this.angleThreshold = CesiumMath.toRadians(125);
31
+ }
32
+
33
+ get enabled() {
34
+ return this._enabled;
35
+ }
36
+
37
+ set enabled(value) {
38
+ this._enabled = value;
39
+ }
40
+
41
+ /**
42
+ * The controller that is used when the camera is looking more horizontally (beyond angleThreshold from nadir).
43
+ * @type {ScreenSpaceElevatorCameraController}
44
+ * @readonly
45
+ */
46
+ get elevatorController() {
47
+ return this._elevatorController;
48
+ }
49
+
50
+ /**
51
+ * The controller that is used when the camera is looking mostly down (within angleThreshold of nadir).
52
+ * @type {ScreenSpaceMapCameraController}
53
+ * @readonly
54
+ */
55
+ get mapController() {
56
+ return this._mapController;
57
+ }
58
+
59
+ /**
60
+ * @inheritdoc
61
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
62
+ */
63
+ connectedCallback(element) {
64
+ this._elevatorController.connectedCallback(element);
65
+ this._mapController.connectedCallback(element);
66
+ }
67
+
68
+ /**
69
+ * @inheritdoc
70
+ * @param {HTMLElement} element The DOM element containing the Cesium scene.
71
+ */
72
+ disconnectedCallback(element) {
73
+ this._elevatorController.disconnectedCallback(element);
74
+ this._mapController.disconnectedCallback(element);
75
+ }
76
+
77
+ /**
78
+ * @inheritdoc
79
+ */
80
+ firstUpdate() {
81
+ this._elevatorController.firstUpdate();
82
+ this._mapController.firstUpdate();
83
+ }
84
+
85
+ /**
86
+ * @inheritdoc
87
+ * @param {Scene} scene
88
+ */
89
+ update(scene) {
90
+ const camera = scene.camera;
91
+ const normal = scene.ellipsoid.geodeticSurfaceNormal(
92
+ camera.positionWC,
93
+ this._ellipsoidNormal,
94
+ );
95
+
96
+ const angle = Math.abs(Cartesian3.angleBetween(normal, camera.directionWC));
97
+ const activeController =
98
+ angle < this.angleThreshold && angle > Math.PI - this.angleThreshold
99
+ ? this._elevatorController
100
+ : this._mapController;
101
+
102
+ activeController.update(scene);
103
+ }
104
+ }
105
+
106
+ export default HybridScreenSpacePanCameraController;
@@ -0,0 +1,32 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * This enumerated type is for classifying mouse buttons: left, middle, and right.
5
+ * @enum {number}
6
+ */
7
+ const MouseButton = {
8
+ /**
9
+ * Represents a mouse left button.
10
+ * @type {number}
11
+ * @constant
12
+ */
13
+ LEFT: 0,
14
+
15
+ /**
16
+ * Represents a mouse middle button.
17
+ * @type {number}
18
+ * @constant
19
+ */
20
+ MIDDLE: 1,
21
+
22
+ /**
23
+ * Represents a mouse right button.
24
+ * @type {number}
25
+ * @constant
26
+ */
27
+ RIGHT: 2,
28
+ };
29
+
30
+ Object.freeze(MouseButton);
31
+
32
+ export default MouseButton;