@hztxi/cesium-engine 25.0.7 → 26.2.1

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 (412) hide show
  1. package/Build/Workers/chunk-2NCNUVAT.js +56 -0
  2. package/Build/Workers/chunk-2ZYRUVVU.js +301 -0
  3. package/Build/Workers/chunk-36IU7N4V.js +1284 -0
  4. package/Build/Workers/chunk-3BDLET5S.js +198 -0
  5. package/Build/Workers/chunk-3PRHI4KX.js +241 -0
  6. package/Build/Workers/chunk-3R6E2SH4.js +672 -0
  7. package/Build/Workers/chunk-3ZKKXEXL.js +415 -0
  8. package/Build/Workers/chunk-47KVKPTO.js +415 -0
  9. package/Build/Workers/chunk-4N227IPR.js +973 -0
  10. package/Build/Workers/chunk-4P6OAPBM.js +97 -0
  11. package/Build/Workers/chunk-4ZOLEPZK.js +519 -0
  12. package/Build/Workers/chunk-5EF3WWQG.js +352 -0
  13. package/Build/Workers/chunk-5I76476T.js +288 -0
  14. package/Build/Workers/chunk-5PBZKBAP.js +511 -0
  15. package/Build/Workers/chunk-5RVAAW26.js +82 -0
  16. package/Build/Workers/chunk-5VWK76PO.js +511 -0
  17. package/Build/Workers/chunk-77DBX23X.js +455 -0
  18. package/Build/Workers/chunk-7GQOWCSN.js +959 -0
  19. package/Build/Workers/chunk-7J2ONMKC.js +198 -0
  20. package/Build/Workers/chunk-7MHUHXZZ.js +219 -0
  21. package/Build/Workers/chunk-7MQPHOAS.js +455 -0
  22. package/Build/Workers/chunk-7NJ5O7TP.js +387 -0
  23. package/Build/Workers/chunk-7Y642MCO.js +352 -0
  24. package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
  25. package/Build/Workers/chunk-A7LGY5XS.js +140 -0
  26. package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
  27. package/Build/Workers/chunk-B7PT2VL5.js +630 -0
  28. package/Build/Workers/chunk-C6XQGBPV.js +476 -0
  29. package/Build/Workers/chunk-CAEC5DA2.js +57 -0
  30. package/Build/Workers/chunk-CBCOHH5O.js +837 -0
  31. package/Build/Workers/chunk-CEMXKBQO.js +1800 -0
  32. package/Build/Workers/chunk-CKW3STKA.js +1067 -0
  33. package/Build/Workers/chunk-CV5RICKT.js +1992 -0
  34. package/Build/Workers/chunk-DBWSISJT.js +56 -0
  35. package/Build/Workers/chunk-DSBSPPPJ.js +1344 -0
  36. package/Build/Workers/chunk-DSGLDRTI.js +278 -0
  37. package/Build/Workers/chunk-DXD7OPSP.js +1992 -0
  38. package/Build/Workers/chunk-DXECZBSA.js +368 -0
  39. package/Build/Workers/chunk-DZIRO6ZK.js +682 -0
  40. package/Build/Workers/chunk-E4CRPGX5.js +140 -0
  41. package/Build/Workers/chunk-E4IVMEBH.js +52 -0
  42. package/Build/Workers/chunk-ECN3VUMA.js +73 -0
  43. package/Build/Workers/chunk-ECSKVHUB.js +476 -0
  44. package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
  45. package/Build/Workers/chunk-FAYBQGKO.js +219 -0
  46. package/Build/Workers/chunk-FGCXPEZM.js +3201 -0
  47. package/Build/Workers/chunk-FHCRXPA6.js +44 -0
  48. package/Build/Workers/chunk-FQ42MT7M.js +58 -0
  49. package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
  50. package/Build/Workers/chunk-FTCBY5HH.js +138 -0
  51. package/Build/Workers/chunk-GI5RWJAY.js +101 -0
  52. package/Build/Workers/chunk-GNLMSDRO.js +945 -0
  53. package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
  54. package/Build/Workers/chunk-HCGU7OCG.js +97 -0
  55. package/Build/Workers/chunk-HRIPVWSC.js +58 -0
  56. package/Build/Workers/chunk-IC3BR6SC.js +102 -0
  57. package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
  58. package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
  59. package/Build/Workers/chunk-KSIEJYNL.js +3822 -0
  60. package/Build/Workers/chunk-KT3GG7AW.js +754 -0
  61. package/Build/Workers/chunk-KYCEM22I.js +1800 -0
  62. package/Build/Workers/chunk-LJTQW46H.js +57 -0
  63. package/Build/Workers/chunk-LMQGYJME.js +672 -0
  64. package/Build/Workers/chunk-LOBYJQA4.js +76 -0
  65. package/Build/Workers/chunk-LOF32O7F.js +163 -0
  66. package/Build/Workers/chunk-LOTIJA7D.js +124 -0
  67. package/Build/Workers/chunk-M7Z3MPAX.js +973 -0
  68. package/Build/Workers/chunk-MHNLTQHO.js +3201 -0
  69. package/Build/Workers/chunk-ML7OMD72.js +2342 -0
  70. package/Build/Workers/chunk-NBTGXEMT.js +945 -0
  71. package/Build/Workers/chunk-NQZC37F7.js +38 -0
  72. package/Build/Workers/chunk-O3X3D2Z3.js +352 -0
  73. package/Build/Workers/chunk-OBUIHPKF.js +352 -0
  74. package/Build/Workers/chunk-PAEWNYIV.js +138 -0
  75. package/Build/Workers/chunk-PANJ7YH6.js +102 -0
  76. package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
  77. package/Build/Workers/chunk-PIIUGRQD.js +387 -0
  78. package/Build/Workers/chunk-POKD22OT.js +2719 -0
  79. package/Build/Workers/chunk-PQMA7MFS.js +9237 -0
  80. package/Build/Workers/chunk-PURIPUSY.js +682 -0
  81. package/Build/Workers/chunk-QQZPPXY4.js +3822 -0
  82. package/Build/Workers/chunk-QXLQLGL2.js +1067 -0
  83. package/Build/Workers/chunk-RC4YC3VU.js +278 -0
  84. package/Build/Workers/chunk-RGNNWVR6.js +171 -0
  85. package/Build/Workers/chunk-SBBIEHYT.js +44 -0
  86. package/Build/Workers/chunk-SWVZTU6X.js +305 -0
  87. package/Build/Workers/chunk-T3EUPM5A.js +454 -0
  88. package/Build/Workers/chunk-TA6IU2XL.js +171 -0
  89. package/Build/Workers/chunk-TLSGD5TR.js +280 -0
  90. package/Build/Workers/chunk-TOXDLWKZ.js +368 -0
  91. package/Build/Workers/chunk-TZBM6TAB.js +124 -0
  92. package/Build/Workers/chunk-U2OY6MX6.js +398 -0
  93. package/Build/Workers/chunk-UCY4B5EV.js +288 -0
  94. package/Build/Workers/chunk-V52FEPCV.js +754 -0
  95. package/Build/Workers/chunk-VBEXZBG5.js +147 -0
  96. package/Build/Workers/chunk-VC76B6GM.js +959 -0
  97. package/Build/Workers/chunk-VCUOYHWC.js +519 -0
  98. package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
  99. package/Build/Workers/chunk-VMF7KOGY.js +162 -0
  100. package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
  101. package/Build/Workers/chunk-XHT5SVP4.js +52 -0
  102. package/Build/Workers/chunk-XITBARMZ.js +2342 -0
  103. package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
  104. package/Build/Workers/chunk-XZ6HDXKM.js +76 -0
  105. package/Build/Workers/chunk-Y7NDFEQ3.js +398 -0
  106. package/Build/Workers/chunk-YBBQDYX2.js +301 -0
  107. package/Build/Workers/chunk-YHPYPVAB.js +837 -0
  108. package/Build/Workers/chunk-YNKK6BXY.js +454 -0
  109. package/Build/Workers/chunk-YRAJ74HR.js +305 -0
  110. package/Build/Workers/chunk-YULTZK5O.js +147 -0
  111. package/Build/Workers/chunk-YUNQYP3Z.js +9237 -0
  112. package/Build/Workers/chunk-Z7BONRW2.js +241 -0
  113. package/Build/Workers/chunk-ZK2R3DEJ.js +1054 -0
  114. package/Build/Workers/combineGeometry.js +24 -24
  115. package/Build/Workers/createBoxGeometry.js +18 -18
  116. package/Build/Workers/createBoxOutlineGeometry.js +18 -18
  117. package/Build/Workers/createCircleGeometry.js +26 -26
  118. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  119. package/Build/Workers/createCoplanarPolygonGeometry.js +39 -39
  120. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -33
  121. package/Build/Workers/createCorridorGeometry.js +36 -37
  122. package/Build/Workers/createCorridorOutlineGeometry.js +34 -35
  123. package/Build/Workers/createCylinderGeometry.js +20 -20
  124. package/Build/Workers/createCylinderOutlineGeometry.js +20 -20
  125. package/Build/Workers/createEllipseGeometry.js +26 -26
  126. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  127. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  128. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  129. package/Build/Workers/createFrustumGeometry.js +18 -18
  130. package/Build/Workers/createFrustumOutlineGeometry.js +20 -20
  131. package/Build/Workers/createGeometry.js +25 -24
  132. package/Build/Workers/createGroundPolylineGeometry.js +26 -26
  133. package/Build/Workers/createMvtTile.js +111 -19
  134. package/Build/Workers/createPlaneGeometry.js +18 -18
  135. package/Build/Workers/createPlaneOutlineGeometry.js +17 -17
  136. package/Build/Workers/createPolygonGeometry.js +36 -36
  137. package/Build/Workers/createPolygonOutlineGeometry.js +33 -33
  138. package/Build/Workers/createPolylineGeometry.js +28 -28
  139. package/Build/Workers/createPolylineVolumeGeometry.js +38 -36
  140. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +32 -31
  141. package/Build/Workers/createRectangleGeometry.js +29 -29
  142. package/Build/Workers/createRectangleOutlineGeometry.js +23 -23
  143. package/Build/Workers/createSimplePolylineGeometry.js +26 -26
  144. package/Build/Workers/createSphereGeometry.js +19 -19
  145. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  146. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  147. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  148. package/Build/Workers/createVectorTileGeometries.js +24 -24
  149. package/Build/Workers/createVectorTilePoints.js +13 -13
  150. package/Build/Workers/createVectorTilePolygons.js +22 -22
  151. package/Build/Workers/createVectorTilePolylines.js +14 -14
  152. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
  153. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
  154. package/Build/Workers/createVerticesFromHeightmap.js +23 -23
  155. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
  156. package/Build/Workers/createWallGeometry.js +26 -26
  157. package/Build/Workers/createWallOutlineGeometry.js +26 -26
  158. package/Build/Workers/decodeDraco.js +10 -10
  159. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +993 -2334
  160. package/Build/Workers/decodeI3S.js +10 -10
  161. package/Build/Workers/gaussianSplatSorter.js +4 -4
  162. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  163. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  164. package/Build/Workers/transcodeKTX2.js +6 -6
  165. package/Build/Workers/transferTypedArrayTest.js +1 -1
  166. package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
  167. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
  168. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
  169. package/Source/Core/BoundingRectangle.js +6 -8
  170. package/Source/Core/BoundingSphere.js +0 -3
  171. package/Source/Core/Cartesian2.js +1 -1
  172. package/Source/Core/Cartesian3.js +1 -1
  173. package/Source/Core/Cartesian4.js +1 -1
  174. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
  175. package/Source/Core/Color.js +1 -0
  176. package/Source/Core/ComponentDatatype.js +35 -0
  177. package/Source/Core/CoplanarPolygonGeometry.js +2 -2
  178. package/Source/Core/CorridorGeometry.js +2 -4
  179. package/Source/Core/CorridorOutlineGeometry.js +1 -3
  180. package/Source/Core/EarthOrientationParameters.js +2 -2
  181. package/Source/Core/EllipseGeometryLibrary.js +2 -2
  182. package/Source/Core/EllipsoidGeodesic.js +3 -3
  183. package/Source/Core/EllipsoidRhumbLine.js +1 -1
  184. package/Source/Core/Heap.js +1 -1
  185. package/Source/Core/HermitePolynomialApproximation.js +215 -179
  186. package/Source/Core/InterpolationAlgorithm.js +58 -50
  187. package/Source/Core/Ion.js +1 -1
  188. package/Source/Core/JulianDate.js +1 -1
  189. package/Source/Core/LagrangePolynomialApproximation.js +55 -52
  190. package/Source/Core/LinearApproximation.js +69 -66
  191. package/Source/Core/MapProjection.js +1 -0
  192. package/Source/Core/Math.js +59 -0
  193. package/Source/Core/Matrix2.js +3 -3
  194. package/Source/Core/Matrix3.js +3 -3
  195. package/Source/Core/Matrix4.js +1 -1
  196. package/Source/Core/OrthographicFrustum.js +1 -1
  197. package/Source/Core/PerspectiveFrustum.js +1 -1
  198. package/Source/Core/PolygonGeometry.js +2 -2
  199. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  200. package/Source/Core/PolygonOutlineGeometry.js +1 -1
  201. package/Source/Core/PolylineGeometry.js +1 -1
  202. package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
  203. package/Source/Core/Rectangle.js +7 -1
  204. package/Source/Core/RectangleOutlineGeometry.js +1 -1
  205. package/Source/Core/Resource.js +1 -1
  206. package/Source/Core/ScreenSpaceEventHandler.js +51 -41
  207. package/Source/Core/SimplePolylineGeometry.js +1 -1
  208. package/Source/Core/TerrainEncoding.js +2 -2
  209. package/Source/Core/TerrainMesh.js +3 -3
  210. package/Source/Core/TerrainPicker.js +180 -168
  211. package/Source/Core/TimeIntervalCollection.js +1 -3
  212. package/Source/Core/Tipsify.js +1 -1
  213. package/Source/Core/Transforms.js +5 -1
  214. package/Source/Core/VectorPipeline.js +1117 -0
  215. package/Source/Core/VectorProvider.js +429 -0
  216. package/Source/Core/WallOutlineGeometry.js +1 -1
  217. package/Source/Core/createColorRamp.js +37 -0
  218. package/Source/Core/getTimestamp.js +4 -2
  219. package/Source/Core/globalTypes.js +25 -0
  220. package/Source/Core/writeTextToCanvas.js +1 -0
  221. package/Source/DataSources/CompositeEntityCollection.js +0 -1
  222. package/Source/DataSources/CzmlDataSource.js +14 -0
  223. package/Source/DataSources/DataSourceDisplay.js +1 -1
  224. package/Source/DataSources/GeoJsonDataSource.js +0 -1
  225. package/Source/DataSources/GeometryVisualizer.js +1 -1
  226. package/Source/DataSources/KmlDataSource.js +529 -557
  227. package/Source/DataSources/PathGraphics.js +8 -1
  228. package/Source/DataSources/PathMode.js +27 -0
  229. package/Source/DataSources/PathVisualizer.js +298 -1
  230. package/Source/DataSources/PolylineVisualizer.js +1 -1
  231. package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
  232. package/Source/Renderer/AutomaticUniforms.js +23 -0
  233. package/Source/Renderer/Context.js +9 -3
  234. package/Source/Renderer/DrawCommand.js +22 -0
  235. package/Source/Renderer/Framebuffer.js +4 -0
  236. package/Source/Renderer/Pass.js +11 -9
  237. package/Source/Renderer/Texture.js +12 -1
  238. package/Source/Renderer/UniformState.js +7 -0
  239. package/Source/Renderer/VertexArray.js +1 -1
  240. package/Source/Renderer/createUniform.js +346 -239
  241. package/Source/Renderer/createUniformArray.js +494 -381
  242. package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
  243. package/Source/Scene/ArcGisMapService.js +1 -1
  244. package/Source/Scene/Billboard.js +2 -1
  245. package/Source/Scene/BillboardCollection.js +15 -5
  246. package/Source/Scene/BillboardTexture.js +5 -3
  247. package/Source/Scene/BufferPointCollection.js +11 -1
  248. package/Source/Scene/BufferPolygonCollection.js +26 -0
  249. package/Source/Scene/BufferPolylineCollection.js +2 -0
  250. package/Source/Scene/BufferPrimitiveCollection.js +105 -32
  251. package/Source/Scene/Camera.js +85 -9
  252. package/Source/Scene/CameraEventAggregator.js +30 -18
  253. package/Source/Scene/CameraFlightPath.js +7 -4
  254. package/Source/Scene/Cesium3DTile.js +102 -4
  255. package/Source/Scene/Cesium3DTileContent.js +195 -254
  256. package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
  257. package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
  258. package/Source/Scene/Cesium3DTileStyle.js +40 -0
  259. package/Source/Scene/Cesium3DTileset.js +213 -8
  260. package/Source/Scene/Cesium3DTilesetTraversal.js +14 -0
  261. package/Source/Scene/ClippingPlaneCollection.js +4 -4
  262. package/Source/Scene/ClippingPolygon.js +2 -0
  263. package/Source/Scene/ClippingPolygonCollection.js +2 -2
  264. package/Source/Scene/Composite3DTileContent.js +254 -292
  265. package/Source/Scene/Controllers/Controller.js +63 -0
  266. package/Source/Scene/Controllers/ControllerHost.js +78 -0
  267. package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
  268. package/Source/Scene/Controllers/MouseButton.js +32 -0
  269. package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
  270. package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
  271. package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
  272. package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
  273. package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
  274. package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
  275. package/Source/Scene/DerivedCommand.js +98 -0
  276. package/Source/Scene/EdgeDisplayMode.js +50 -0
  277. package/Source/Scene/EdgeFramebuffer.js +1 -5
  278. package/Source/Scene/Empty3DTileContent.js +100 -132
  279. package/Source/Scene/Expression.js +6 -8
  280. package/Source/Scene/FrameState.js +17 -0
  281. package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
  282. package/Source/Scene/GeoJsonPrimitive.js +874 -0
  283. package/Source/Scene/Geometry3DTileContent.js +151 -185
  284. package/Source/Scene/Globe.js +22 -1
  285. package/Source/Scene/GlobeDepth.js +27 -1
  286. package/Source/Scene/GlobeSurfaceShaderSet.js +637 -540
  287. package/Source/Scene/GlobeSurfaceTile.js +575 -398
  288. package/Source/Scene/GlobeSurfaceTileProvider.js +1412 -1184
  289. package/Source/Scene/GltfBufferViewLoader.js +3 -3
  290. package/Source/Scene/GltfLoader.js +146 -3
  291. package/Source/Scene/GltfLoaderUtil.js +20 -4
  292. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
  293. package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
  294. package/Source/Scene/GltfSpzLoader.js +1 -1
  295. package/Source/Scene/GltfVertexBufferLoader.js +6 -3
  296. package/Source/Scene/I3SDataProvider.js +1 -1
  297. package/Source/Scene/I3SLayer.js +1 -1
  298. package/Source/Scene/I3SNode.js +2 -2
  299. package/Source/Scene/ImageryLayer.js +2 -2
  300. package/Source/Scene/ImageryLayerCollection.js +190 -6
  301. package/Source/Scene/Implicit3DTileContent.js +192 -216
  302. package/Source/Scene/ImplicitTileCoordinates.js +17 -0
  303. package/Source/Scene/IonImageryProvider.js +1 -5
  304. package/Source/Scene/Label.js +4 -4
  305. package/Source/Scene/LabelCollection.js +4 -1
  306. package/Source/Scene/MVTDataProvider.js +555 -0
  307. package/Source/Scene/Material.js +1 -0
  308. package/Source/Scene/Model/B3dmLoader.js +1 -2
  309. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +82 -312
  310. package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
  311. package/Source/Scene/Model/I3dmLoader.js +1 -1
  312. package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
  313. package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
  314. package/Source/Scene/Model/Model.js +45 -10
  315. package/Source/Scene/Model/Model3DTileContent.js +424 -458
  316. package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
  317. package/Source/Scene/Model/ModelDrawCommand.js +180 -8
  318. package/Source/Scene/Model/ModelDrawCommands.js +4 -0
  319. package/Source/Scene/Model/ModelSceneGraph.js +21 -0
  320. package/Source/Scene/Model/ModelUtility.js +5 -0
  321. package/Source/Scene/Model/PickingPipelineStage.js +29 -0
  322. package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
  323. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +645 -153
  324. package/Source/Scene/ModelComponents.js +112 -0
  325. package/Source/Scene/Multiple3DTileContent.js +291 -334
  326. package/Source/Scene/MvtLabelCandidates.js +295 -0
  327. package/Source/Scene/MvtLabelManager.js +1069 -0
  328. package/Source/Scene/Picking.js +19 -3
  329. package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
  330. package/Source/Scene/PntsParser.js +1 -1
  331. package/Source/Scene/PolylineCollection.js +5 -3
  332. package/Source/Scene/PostProcessStage.js +4 -2
  333. package/Source/Scene/QuadtreePrimitive.js +3 -2
  334. package/Source/Scene/ResourceCache.js +7 -4
  335. package/Source/Scene/ResourceCacheKey.js +21 -18
  336. package/Source/Scene/Scene.js +237 -11
  337. package/Source/Scene/SceneTransforms.js +6 -5
  338. package/Source/Scene/ShadowMap.js +9 -3
  339. package/Source/Scene/ShadowMapShader.js +50 -2
  340. package/Source/Scene/SnapFramebuffer.js +121 -0
  341. package/Source/Scene/Snapping.js +184 -0
  342. package/Source/Scene/TerrainFillMesh.js +3 -2
  343. package/Source/Scene/Tileset3DTileContent.js +113 -146
  344. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +543 -0
  345. package/Source/Scene/Vector3DTileContent.js +207 -237
  346. package/Source/Scene/VectorGltf3DTileContent.js +185 -45
  347. package/Source/Scene/View.js +10 -8
  348. package/Source/Scene/VoxelPrimitive.js +159 -175
  349. package/Source/Scene/VoxelProvider.js +64 -91
  350. package/Source/Scene/VoxelTraversal.js +1 -1
  351. package/Source/Scene/buildVectorGltfFromMVT.js +1208 -0
  352. package/Source/Scene/buildVoxelCustomShader.js +199 -0
  353. package/Source/Scene/createElevationBandMaterial.js +1 -1
  354. package/Source/Scene/decodeMVT.js +877 -0
  355. package/Source/Scene/findMeshoptExtension.js +23 -0
  356. package/Source/Scene/renderBufferPointCollection.js +114 -64
  357. package/Source/Scene/renderBufferPolygonCollection.js +245 -53
  358. package/Source/Scene/renderBufferPolylineCollection.js +271 -145
  359. package/Source/Shaders/BillboardCollectionVS.glsl +23 -25
  360. package/Source/Shaders/BillboardCollectionVS.js +23 -25
  361. package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
  362. package/Source/Shaders/BufferPointMaterialFS.js +1 -0
  363. package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
  364. package/Source/Shaders/BufferPointMaterialVS.js +20 -10
  365. package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
  366. package/Source/Shaders/BufferPolygonMaterialFS.js +13 -0
  367. package/Source/Shaders/BufferPolygonMaterialVS.glsl +22 -4
  368. package/Source/Shaders/BufferPolygonMaterialVS.js +23 -5
  369. package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
  370. package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
  371. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  372. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  373. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  374. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  375. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  376. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  377. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
  378. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  379. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
  380. package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
  381. package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
  382. package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
  383. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  384. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  385. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  386. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  387. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  388. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  389. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  390. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  391. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  392. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  393. package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
  394. package/Source/Shaders/GlobeFS.glsl +10 -6
  395. package/Source/Shaders/GlobeFS.js +10 -6
  396. package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
  397. package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
  398. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
  399. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
  400. package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
  401. package/Source/Shaders/Model/MaterialStageFS.js +8 -2
  402. package/Source/Shaders/Model/ModelFS.glsl +105 -0
  403. package/Source/Shaders/Model/ModelFS.js +105 -0
  404. package/Source/Shaders/VectorCommon.glsl +178 -0
  405. package/Source/Shaders/VectorCommon.js +180 -0
  406. package/Source/ThirdParty/zip-module.wasm +0 -0
  407. package/Source/Widget/CesiumWidget.js +30 -0
  408. package/Source/Workers/createMvtTile.js +39 -0
  409. package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
  410. package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
  411. package/index.js +113 -83
  412. package/package.json +13 -13
@@ -0,0 +1,352 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.144.0
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ IndexDatatype_default
28
+ } from "./chunk-E4CRPGX5.js";
29
+ import {
30
+ Math_default
31
+ } from "./chunk-VCUOYHWC.js";
32
+ import {
33
+ DeveloperError_default
34
+ } from "./chunk-XLQZNQ4Z.js";
35
+ import {
36
+ defined_default
37
+ } from "./chunk-PCL3Y7H5.js";
38
+
39
+ // packages/engine/Source/Core/TerrainProvider.js
40
+ function TerrainProvider() {
41
+ DeveloperError_default.throwInstantiationError();
42
+ }
43
+ Object.defineProperties(TerrainProvider.prototype, {
44
+ /**
45
+ * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
46
+ * to the event, you will be notified of the error and can potentially recover from it. Event listeners
47
+ * are passed an instance of {@link TileProviderError}.
48
+ * @memberof TerrainProvider.prototype
49
+ * @type {Event<TerrainProvider.ErrorEvent>}
50
+ * @readonly
51
+ */
52
+ errorEvent: {
53
+ get: DeveloperError_default.throwInstantiationError
54
+ },
55
+ /**
56
+ * Gets the credit to display when this terrain provider is active. Typically this is used to credit
57
+ * the source of the terrain.
58
+ * @memberof TerrainProvider.prototype
59
+ * @type {Credit}
60
+ * @readonly
61
+ */
62
+ credit: {
63
+ get: DeveloperError_default.throwInstantiationError
64
+ },
65
+ /**
66
+ * Gets the tiling scheme used by the provider.
67
+ * @memberof TerrainProvider.prototype
68
+ * @type {TilingScheme}
69
+ * @readonly
70
+ */
71
+ tilingScheme: {
72
+ get: DeveloperError_default.throwInstantiationError
73
+ },
74
+ /**
75
+ * Gets a value indicating whether or not the provider includes a water mask. The water mask
76
+ * indicates which areas of the globe are water rather than land, so they can be rendered
77
+ * as a reflective surface with animated waves.
78
+ * @memberof TerrainProvider.prototype
79
+ * @type {boolean}
80
+ * @readonly
81
+ */
82
+ hasWaterMask: {
83
+ get: DeveloperError_default.throwInstantiationError
84
+ },
85
+ /**
86
+ * Gets a value indicating whether or not the requested tiles include vertex normals.
87
+ * @memberof TerrainProvider.prototype
88
+ * @type {boolean}
89
+ * @readonly
90
+ */
91
+ hasVertexNormals: {
92
+ get: DeveloperError_default.throwInstantiationError
93
+ },
94
+ /**
95
+ * Gets an object that can be used to determine availability of terrain from this provider, such as
96
+ * at points and in rectangles. This property may be undefined if availability
97
+ * information is not available.
98
+ * @memberof TerrainProvider.prototype
99
+ * @type {TileAvailability|undefined}
100
+ * @readonly
101
+ */
102
+ availability: {
103
+ get: DeveloperError_default.throwInstantiationError
104
+ }
105
+ });
106
+ var regularGridIndicesCache = [];
107
+ TerrainProvider.getRegularGridIndices = function(width, height) {
108
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
109
+ throw new DeveloperError_default(
110
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
111
+ );
112
+ }
113
+ let byWidth = regularGridIndicesCache[width];
114
+ if (!defined_default(byWidth)) {
115
+ regularGridIndicesCache[width] = byWidth = [];
116
+ }
117
+ let indices = byWidth[height];
118
+ if (!defined_default(indices)) {
119
+ if (width * height < Math_default.SIXTY_FOUR_KILOBYTES) {
120
+ indices = byWidth[height] = new Uint16Array(
121
+ (width - 1) * (height - 1) * 6
122
+ );
123
+ } else {
124
+ indices = byWidth[height] = new Uint32Array(
125
+ (width - 1) * (height - 1) * 6
126
+ );
127
+ }
128
+ addRegularGridIndices(width, height, indices, 0);
129
+ }
130
+ return indices;
131
+ };
132
+ var regularGridAndEdgeIndicesCache = [];
133
+ TerrainProvider.getRegularGridIndicesAndEdgeIndices = function(width, height) {
134
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
135
+ throw new DeveloperError_default(
136
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
137
+ );
138
+ }
139
+ let byWidth = regularGridAndEdgeIndicesCache[width];
140
+ if (!defined_default(byWidth)) {
141
+ regularGridAndEdgeIndicesCache[width] = byWidth = [];
142
+ }
143
+ let indicesAndEdges = byWidth[height];
144
+ if (!defined_default(indicesAndEdges)) {
145
+ const indices = TerrainProvider.getRegularGridIndices(width, height);
146
+ const edgeIndices = getEdgeIndices(width, height);
147
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
148
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
149
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
150
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
151
+ indicesAndEdges = byWidth[height] = {
152
+ indices,
153
+ westIndicesSouthToNorth,
154
+ southIndicesEastToWest,
155
+ eastIndicesNorthToSouth,
156
+ northIndicesWestToEast
157
+ };
158
+ }
159
+ return indicesAndEdges;
160
+ };
161
+ var regularGridAndSkirtAndEdgeIndicesCache = [];
162
+ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function(width, height) {
163
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
164
+ throw new DeveloperError_default(
165
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
166
+ );
167
+ }
168
+ let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];
169
+ if (!defined_default(byWidth)) {
170
+ regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];
171
+ }
172
+ let indicesAndEdges = byWidth[height];
173
+ if (!defined_default(indicesAndEdges)) {
174
+ const gridVertexCount = width * height;
175
+ const gridIndexCount = (width - 1) * (height - 1) * 6;
176
+ const edgeVertexCount = width * 2 + height * 2;
177
+ const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;
178
+ const vertexCount = gridVertexCount + edgeVertexCount;
179
+ const indexCount = gridIndexCount + edgeIndexCount;
180
+ const edgeIndices = getEdgeIndices(width, height);
181
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
182
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
183
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
184
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
185
+ const indices = IndexDatatype_default.createTypedArray(vertexCount, indexCount);
186
+ addRegularGridIndices(width, height, indices, 0);
187
+ TerrainProvider.addSkirtIndices(
188
+ westIndicesSouthToNorth,
189
+ southIndicesEastToWest,
190
+ eastIndicesNorthToSouth,
191
+ northIndicesWestToEast,
192
+ gridVertexCount,
193
+ indices,
194
+ gridIndexCount
195
+ );
196
+ indicesAndEdges = byWidth[height] = {
197
+ indices,
198
+ westIndicesSouthToNorth,
199
+ southIndicesEastToWest,
200
+ eastIndicesNorthToSouth,
201
+ northIndicesWestToEast,
202
+ indexCountWithoutSkirts: gridIndexCount
203
+ };
204
+ }
205
+ return indicesAndEdges;
206
+ };
207
+ TerrainProvider.getSkirtVertexCount = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast) {
208
+ return westIndicesSouthToNorth.length + southIndicesEastToWest.length + eastIndicesNorthToSouth.length + northIndicesWestToEast.length;
209
+ };
210
+ TerrainProvider.getSkirtIndexCount = function(skirtVertexCount) {
211
+ return (skirtVertexCount - 4) * 2 * 3;
212
+ };
213
+ TerrainProvider.getSkirtIndexCountWithFilledCorners = function(skirtVertexCount) {
214
+ return ((skirtVertexCount - 4) * 2 + 4) * 3;
215
+ };
216
+ TerrainProvider.addSkirtIndices = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
217
+ let vertexIndex = vertexCount;
218
+ offset = addSkirtIndices(
219
+ westIndicesSouthToNorth,
220
+ vertexIndex,
221
+ indices,
222
+ offset
223
+ );
224
+ vertexIndex += westIndicesSouthToNorth.length;
225
+ offset = addSkirtIndices(
226
+ southIndicesEastToWest,
227
+ vertexIndex,
228
+ indices,
229
+ offset
230
+ );
231
+ vertexIndex += southIndicesEastToWest.length;
232
+ offset = addSkirtIndices(
233
+ eastIndicesNorthToSouth,
234
+ vertexIndex,
235
+ indices,
236
+ offset
237
+ );
238
+ vertexIndex += eastIndicesNorthToSouth.length;
239
+ addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);
240
+ };
241
+ TerrainProvider.addSkirtIndicesWithFilledCorners = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
242
+ TerrainProvider.addSkirtIndices(
243
+ westIndicesSouthToNorth,
244
+ southIndicesEastToWest,
245
+ eastIndicesNorthToSouth,
246
+ northIndicesWestToEast,
247
+ vertexCount,
248
+ indices,
249
+ offset
250
+ );
251
+ const skirtVertexCount = TerrainProvider.getSkirtVertexCount(
252
+ westIndicesSouthToNorth,
253
+ southIndicesEastToWest,
254
+ eastIndicesNorthToSouth,
255
+ northIndicesWestToEast
256
+ );
257
+ const skirtIndexCountWithoutCaps = TerrainProvider.getSkirtIndexCount(skirtVertexCount);
258
+ const cornerStartIdx = offset + skirtIndexCountWithoutCaps;
259
+ const cornerSWIndex = westIndicesSouthToNorth[0];
260
+ const cornerNWIndex = northIndicesWestToEast[0];
261
+ const cornerNEIndex = eastIndicesNorthToSouth[0];
262
+ const cornerSEIndex = southIndicesEastToWest[0];
263
+ const westSouthIndex = vertexCount;
264
+ const westNorthIndex = westSouthIndex + westIndicesSouthToNorth.length - 1;
265
+ const southEastIndex = westNorthIndex + 1;
266
+ const southWestIndex = southEastIndex + southIndicesEastToWest.length - 1;
267
+ const eastNorthIndex = southWestIndex + 1;
268
+ const eastSouthIndex = eastNorthIndex + eastIndicesNorthToSouth.length - 1;
269
+ const northWestIndex = eastSouthIndex + 1;
270
+ const northEastIndex = northWestIndex + northIndicesWestToEast.length - 1;
271
+ indices[cornerStartIdx + 0] = cornerSWIndex;
272
+ indices[cornerStartIdx + 1] = westSouthIndex;
273
+ indices[cornerStartIdx + 2] = southWestIndex;
274
+ indices[cornerStartIdx + 3] = cornerSEIndex;
275
+ indices[cornerStartIdx + 4] = southEastIndex;
276
+ indices[cornerStartIdx + 5] = eastSouthIndex;
277
+ indices[cornerStartIdx + 6] = cornerNEIndex;
278
+ indices[cornerStartIdx + 7] = eastNorthIndex;
279
+ indices[cornerStartIdx + 8] = northEastIndex;
280
+ indices[cornerStartIdx + 9] = cornerNWIndex;
281
+ indices[cornerStartIdx + 10] = northWestIndex;
282
+ indices[cornerStartIdx + 11] = westNorthIndex;
283
+ };
284
+ function getEdgeIndices(width, height) {
285
+ const westIndicesSouthToNorth = new Array(height);
286
+ const southIndicesEastToWest = new Array(width);
287
+ const eastIndicesNorthToSouth = new Array(height);
288
+ const northIndicesWestToEast = new Array(width);
289
+ let i;
290
+ for (i = 0; i < width; ++i) {
291
+ northIndicesWestToEast[i] = i;
292
+ southIndicesEastToWest[i] = width * height - 1 - i;
293
+ }
294
+ for (i = 0; i < height; ++i) {
295
+ eastIndicesNorthToSouth[i] = (i + 1) * width - 1;
296
+ westIndicesSouthToNorth[i] = (height - i - 1) * width;
297
+ }
298
+ return {
299
+ westIndicesSouthToNorth,
300
+ southIndicesEastToWest,
301
+ eastIndicesNorthToSouth,
302
+ northIndicesWestToEast
303
+ };
304
+ }
305
+ function addRegularGridIndices(width, height, indices, offset) {
306
+ let index = 0;
307
+ for (let j = 0; j < height - 1; ++j) {
308
+ for (let i = 0; i < width - 1; ++i) {
309
+ const upperLeft = index;
310
+ const lowerLeft = upperLeft + width;
311
+ const lowerRight = lowerLeft + 1;
312
+ const upperRight = upperLeft + 1;
313
+ indices[offset++] = upperLeft;
314
+ indices[offset++] = lowerLeft;
315
+ indices[offset++] = upperRight;
316
+ indices[offset++] = upperRight;
317
+ indices[offset++] = lowerLeft;
318
+ indices[offset++] = lowerRight;
319
+ ++index;
320
+ }
321
+ ++index;
322
+ }
323
+ }
324
+ function addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {
325
+ let previousIndex = edgeIndices[0];
326
+ const length = edgeIndices.length;
327
+ for (let i = 1; i < length; ++i) {
328
+ const index = edgeIndices[i];
329
+ indices[offset++] = previousIndex;
330
+ indices[offset++] = index;
331
+ indices[offset++] = vertexIndex;
332
+ indices[offset++] = vertexIndex;
333
+ indices[offset++] = index;
334
+ indices[offset++] = vertexIndex + 1;
335
+ previousIndex = index;
336
+ ++vertexIndex;
337
+ }
338
+ return offset;
339
+ }
340
+ TerrainProvider.heightmapTerrainQuality = 0.25;
341
+ TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero) {
342
+ return ellipsoid.maximumRadius * 2 * Math.PI * TerrainProvider.heightmapTerrainQuality / (tileImageWidth * numberOfTilesAtLevelZero);
343
+ };
344
+ TerrainProvider.prototype.requestTileGeometry = DeveloperError_default.throwInstantiationError;
345
+ TerrainProvider.prototype.getLevelMaximumGeometricError = DeveloperError_default.throwInstantiationError;
346
+ TerrainProvider.prototype.getTileDataAvailable = DeveloperError_default.throwInstantiationError;
347
+ TerrainProvider.prototype.loadTileDataAvailability = DeveloperError_default.throwInstantiationError;
348
+ var TerrainProvider_default = TerrainProvider;
349
+
350
+ export {
351
+ TerrainProvider_default
352
+ };
@@ -0,0 +1,288 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.144.1
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ AxisAlignedBoundingBox_default
28
+ } from "./chunk-EL4B5CSQ.js";
29
+ import {
30
+ IntersectionTests_default,
31
+ Ray_default
32
+ } from "./chunk-DSBSPPPJ.js";
33
+ import {
34
+ Plane_default
35
+ } from "./chunk-TA6IU2XL.js";
36
+ import {
37
+ Transforms_default
38
+ } from "./chunk-YUNQYP3Z.js";
39
+ import {
40
+ Cartesian4_default,
41
+ Matrix4_default
42
+ } from "./chunk-MHNLTQHO.js";
43
+ import {
44
+ Cartesian2_default,
45
+ Ellipsoid_default
46
+ } from "./chunk-CV5RICKT.js";
47
+ import {
48
+ Cartesian3_default
49
+ } from "./chunk-XITBARMZ.js";
50
+ import {
51
+ Check_default,
52
+ DeveloperError_default
53
+ } from "./chunk-LOF32O7F.js";
54
+ import {
55
+ defined_default
56
+ } from "./chunk-5RVAAW26.js";
57
+
58
+ // packages/engine/Source/Core/EllipsoidTangentPlane.js
59
+ var scratchCart4 = new Cartesian4_default();
60
+ function EllipsoidTangentPlane(origin, ellipsoid) {
61
+ Check_default.defined("origin", origin);
62
+ ellipsoid = ellipsoid ?? Ellipsoid_default.default;
63
+ origin = ellipsoid.scaleToGeodeticSurface(origin);
64
+ if (!defined_default(origin)) {
65
+ throw new DeveloperError_default(
66
+ "origin must not be at the center of the ellipsoid."
67
+ );
68
+ }
69
+ const eastNorthUp = Transforms_default.eastNorthUpToFixedFrame(origin, ellipsoid);
70
+ this._ellipsoid = ellipsoid;
71
+ this._origin = origin;
72
+ this._xAxis = Cartesian3_default.fromCartesian4(
73
+ Matrix4_default.getColumn(eastNorthUp, 0, scratchCart4)
74
+ );
75
+ this._yAxis = Cartesian3_default.fromCartesian4(
76
+ Matrix4_default.getColumn(eastNorthUp, 1, scratchCart4)
77
+ );
78
+ const normal = Cartesian3_default.fromCartesian4(
79
+ Matrix4_default.getColumn(eastNorthUp, 2, scratchCart4)
80
+ );
81
+ this._plane = Plane_default.fromPointNormal(origin, normal);
82
+ }
83
+ Object.defineProperties(EllipsoidTangentPlane.prototype, {
84
+ /**
85
+ * Gets the ellipsoid.
86
+ * @memberof EllipsoidTangentPlane.prototype
87
+ * @type {Ellipsoid}
88
+ */
89
+ ellipsoid: {
90
+ get: function() {
91
+ return this._ellipsoid;
92
+ }
93
+ },
94
+ /**
95
+ * Gets the origin.
96
+ * @memberof EllipsoidTangentPlane.prototype
97
+ * @type {Cartesian3}
98
+ */
99
+ origin: {
100
+ get: function() {
101
+ return this._origin;
102
+ }
103
+ },
104
+ /**
105
+ * Gets the plane which is tangent to the ellipsoid.
106
+ * @memberof EllipsoidTangentPlane.prototype
107
+ * @readonly
108
+ * @type {Plane}
109
+ */
110
+ plane: {
111
+ get: function() {
112
+ return this._plane;
113
+ }
114
+ },
115
+ /**
116
+ * Gets the local X-axis (east) of the tangent plane.
117
+ * @memberof EllipsoidTangentPlane.prototype
118
+ * @readonly
119
+ * @type {Cartesian3}
120
+ */
121
+ xAxis: {
122
+ get: function() {
123
+ return this._xAxis;
124
+ }
125
+ },
126
+ /**
127
+ * Gets the local Y-axis (north) of the tangent plane.
128
+ * @memberof EllipsoidTangentPlane.prototype
129
+ * @readonly
130
+ * @type {Cartesian3}
131
+ */
132
+ yAxis: {
133
+ get: function() {
134
+ return this._yAxis;
135
+ }
136
+ },
137
+ /**
138
+ * Gets the local Z-axis (up) of the tangent plane.
139
+ * @memberof EllipsoidTangentPlane.prototype
140
+ * @readonly
141
+ * @type {Cartesian3}
142
+ */
143
+ zAxis: {
144
+ get: function() {
145
+ return this._plane.normal;
146
+ }
147
+ }
148
+ });
149
+ var tmp = new AxisAlignedBoundingBox_default();
150
+ EllipsoidTangentPlane.fromPoints = function(cartesians, ellipsoid) {
151
+ Check_default.defined("cartesians", cartesians);
152
+ const box = AxisAlignedBoundingBox_default.fromPoints(cartesians, tmp);
153
+ return new EllipsoidTangentPlane(box.center, ellipsoid);
154
+ };
155
+ var scratchProjectPointOntoPlaneRay = new Ray_default();
156
+ var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
157
+ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function(cartesian, result) {
158
+ Check_default.defined("cartesian", cartesian);
159
+ const ray = scratchProjectPointOntoPlaneRay;
160
+ ray.origin = cartesian;
161
+ Cartesian3_default.normalize(cartesian, ray.direction);
162
+ let intersectionPoint = IntersectionTests_default.rayPlane(
163
+ ray,
164
+ this._plane,
165
+ scratchProjectPointOntoPlaneCartesian3
166
+ );
167
+ if (!defined_default(intersectionPoint)) {
168
+ Cartesian3_default.negate(ray.direction, ray.direction);
169
+ intersectionPoint = IntersectionTests_default.rayPlane(
170
+ ray,
171
+ this._plane,
172
+ scratchProjectPointOntoPlaneCartesian3
173
+ );
174
+ }
175
+ if (defined_default(intersectionPoint)) {
176
+ const v = Cartesian3_default.subtract(
177
+ intersectionPoint,
178
+ this._origin,
179
+ intersectionPoint
180
+ );
181
+ const x = Cartesian3_default.dot(this._xAxis, v);
182
+ const y = Cartesian3_default.dot(this._yAxis, v);
183
+ if (!defined_default(result)) {
184
+ return new Cartesian2_default(x, y);
185
+ }
186
+ result.x = x;
187
+ result.y = y;
188
+ return result;
189
+ }
190
+ return void 0;
191
+ };
192
+ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(cartesians, result) {
193
+ Check_default.defined("cartesians", cartesians);
194
+ if (!defined_default(result)) {
195
+ result = [];
196
+ }
197
+ let count = 0;
198
+ const length = cartesians.length;
199
+ for (let i = 0; i < length; i++) {
200
+ const p = this.projectPointOntoPlane(cartesians[i], result[count]);
201
+ if (defined_default(p)) {
202
+ result[count] = p;
203
+ count++;
204
+ }
205
+ }
206
+ result.length = count;
207
+ return result;
208
+ };
209
+ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function(cartesian, result) {
210
+ Check_default.defined("cartesian", cartesian);
211
+ if (!defined_default(result)) {
212
+ result = new Cartesian2_default();
213
+ }
214
+ const ray = scratchProjectPointOntoPlaneRay;
215
+ ray.origin = cartesian;
216
+ Cartesian3_default.clone(this._plane.normal, ray.direction);
217
+ let intersectionPoint = IntersectionTests_default.rayPlane(
218
+ ray,
219
+ this._plane,
220
+ scratchProjectPointOntoPlaneCartesian3
221
+ );
222
+ if (!defined_default(intersectionPoint)) {
223
+ Cartesian3_default.negate(ray.direction, ray.direction);
224
+ intersectionPoint = IntersectionTests_default.rayPlane(
225
+ ray,
226
+ this._plane,
227
+ scratchProjectPointOntoPlaneCartesian3
228
+ );
229
+ }
230
+ const v = Cartesian3_default.subtract(
231
+ intersectionPoint,
232
+ this._origin,
233
+ intersectionPoint
234
+ );
235
+ const x = Cartesian3_default.dot(this._xAxis, v);
236
+ const y = Cartesian3_default.dot(this._yAxis, v);
237
+ result.x = x;
238
+ result.y = y;
239
+ return result;
240
+ };
241
+ EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function(cartesians, result) {
242
+ Check_default.defined("cartesians", cartesians);
243
+ if (!defined_default(result)) {
244
+ result = [];
245
+ }
246
+ const length = cartesians.length;
247
+ result.length = length;
248
+ for (let i = 0; i < length; i++) {
249
+ result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
250
+ }
251
+ return result;
252
+ };
253
+ var projectPointsOntoEllipsoidScratch = new Cartesian3_default();
254
+ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function(cartesian, result) {
255
+ Check_default.defined("cartesian", cartesian);
256
+ if (!defined_default(result)) {
257
+ result = new Cartesian3_default();
258
+ }
259
+ const ellipsoid = this._ellipsoid;
260
+ const origin = this._origin;
261
+ const xAxis = this._xAxis;
262
+ const yAxis = this._yAxis;
263
+ const tmp2 = projectPointsOntoEllipsoidScratch;
264
+ Cartesian3_default.multiplyByScalar(xAxis, cartesian.x, tmp2);
265
+ result = Cartesian3_default.add(origin, tmp2, result);
266
+ Cartesian3_default.multiplyByScalar(yAxis, cartesian.y, tmp2);
267
+ Cartesian3_default.add(result, tmp2, result);
268
+ ellipsoid.scaleToGeocentricSurface(result, result);
269
+ return result;
270
+ };
271
+ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(cartesians, result) {
272
+ Check_default.defined("cartesians", cartesians);
273
+ const length = cartesians.length;
274
+ if (!defined_default(result)) {
275
+ result = new Array(length);
276
+ } else {
277
+ result.length = length;
278
+ }
279
+ for (let i = 0; i < length; ++i) {
280
+ result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
281
+ }
282
+ return result;
283
+ };
284
+ var EllipsoidTangentPlane_default = EllipsoidTangentPlane;
285
+
286
+ export {
287
+ EllipsoidTangentPlane_default
288
+ };