@cesium/engine 26.2.0 → 26.3.1-wasm.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +707 -600
  2. package/Build/Workers/chunk-2P3WKV6V.js +290 -0
  3. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
  4. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
  5. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
  6. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
  7. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
  8. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
  9. package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
  10. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
  11. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
  12. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
  13. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
  14. package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
  15. package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
  16. package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
  17. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
  18. package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
  19. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
  20. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
  21. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
  22. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
  23. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
  24. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
  25. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
  26. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
  27. package/Build/Workers/chunk-NYKURYFR.js +2131 -0
  28. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
  29. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
  30. package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
  31. package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
  32. package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
  33. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
  34. package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
  35. package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
  36. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
  37. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
  38. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
  39. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
  40. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
  41. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
  42. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
  43. package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
  44. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
  45. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
  46. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
  47. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
  48. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
  49. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
  50. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
  52. package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
  53. package/Build/Workers/chunk-YUICDZKO.js +2660 -0
  54. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
  55. package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
  56. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
  57. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
  58. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
  59. package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
  60. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
  61. package/Build/Workers/combineGeometry.js +24 -24
  62. package/Build/Workers/createBoxGeometry.js +18 -18
  63. package/Build/Workers/createBoxOutlineGeometry.js +20 -19
  64. package/Build/Workers/createCircleGeometry.js +28 -27
  65. package/Build/Workers/createCircleOutlineGeometry.js +21 -20
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
  68. package/Build/Workers/createCorridorGeometry.js +31 -31
  69. package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
  70. package/Build/Workers/createCylinderGeometry.js +20 -20
  71. package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
  72. package/Build/Workers/createEllipseGeometry.js +26 -26
  73. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  74. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  76. package/Build/Workers/createFrustumGeometry.js +18 -18
  77. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  78. package/Build/Workers/createGeometry.js +27 -26
  79. package/Build/Workers/createGroundPolylineGeometry.js +27 -26
  80. package/Build/Workers/createPlaneGeometry.js +18 -17
  81. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  82. package/Build/Workers/createPolygonGeometry.js +35 -35
  83. package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
  84. package/Build/Workers/createPolylineGeometry.js +28 -29
  85. package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
  87. package/Build/Workers/createRectangleGeometry.js +30 -30
  88. package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
  89. package/Build/Workers/createSimplePolylineGeometry.js +26 -27
  90. package/Build/Workers/createSphereGeometry.js +19 -19
  91. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  92. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  93. package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
  94. package/Build/Workers/createVectorTileGeometries.js +24 -24
  95. package/Build/Workers/createVectorTilePoints.js +13 -13
  96. package/Build/Workers/createVectorTilePolygons.js +22 -22
  97. package/Build/Workers/createVectorTilePolylines.js +17 -16
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
  100. package/Build/Workers/createVerticesFromHeightmap.js +24 -25
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  102. package/Build/Workers/createWallGeometry.js +27 -28
  103. package/Build/Workers/createWallOutlineGeometry.js +26 -27
  104. package/Build/Workers/decodeDraco.js +16 -12
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
  106. package/Build/Workers/decodeI3S.js +17 -12
  107. package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
  108. package/Build/Workers/decodeSpz.js +1960 -0
  109. package/Build/Workers/gaussianSplatSorter.js +13 -6
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
  112. package/Build/Workers/transcodeKTX2.js +26 -12
  113. package/Build/Workers/transferTypedArrayTest.js +1 -1
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  116. package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
  117. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/IonResource.js +5 -0
  120. package/Source/Core/IonSnapGeometryType.js +59 -0
  121. package/Source/Core/IonSnapHeat.js +33 -0
  122. package/Source/Core/IonSnapMode.js +45 -0
  123. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  124. package/Source/Core/IonSnapService.js +369 -0
  125. package/Source/Core/KTX2Transcoder.js +99 -5
  126. package/Source/Core/Resource.js +2 -0
  127. package/Source/Core/SnapService.js +63 -0
  128. package/Source/Core/TaskProcessor.js +249 -129
  129. package/Source/Core/TrustedServers.js +34 -1
  130. package/Source/Core/VectorPipeline.js +139 -45
  131. package/Source/Core/VectorProvider.js +311 -71
  132. package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
  133. package/Source/Core/fetchWebAssemblyBinary.js +52 -0
  134. package/Source/Renderer/AutomaticUniforms.js +44 -2
  135. package/Source/Renderer/ShaderBuilder.js +1 -1
  136. package/Source/Renderer/UniformState.js +47 -1
  137. package/Source/Scene/ArcGisMapService.js +1 -1
  138. package/Source/Scene/BufferPointCollection.js +4 -7
  139. package/Source/Scene/BufferPolygonCollection.js +56 -27
  140. package/Source/Scene/BufferPolylineCollection.js +61 -8
  141. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  142. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  143. package/Source/Scene/Cesium3DTile.js +12 -0
  144. package/Source/Scene/Cesium3DTileset.js +61 -8
  145. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  146. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  147. package/Source/Scene/ClippingPolygon.js +154 -100
  148. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  149. package/Source/Scene/CreditDisplay.js +62 -0
  150. package/Source/Scene/GaussianSplatPrimitive.js +153 -66
  151. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  152. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  153. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  154. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  155. package/Source/Scene/GltfBufferViewLoader.js +25 -13
  156. package/Source/Scene/GltfLoader.js +56 -6
  157. package/Source/Scene/GltfSpzLoader.js +5 -4
  158. package/Source/Scene/HeightReference.js +1 -1
  159. package/Source/Scene/MVTDataProvider.js +9 -0
  160. package/Source/Scene/Model/Model.js +242 -16
  161. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  162. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  163. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  164. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  165. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  166. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  167. package/Source/Scene/PostProcessStage.js +22 -3
  168. package/Source/Scene/Scene.js +56 -1
  169. package/Source/Scene/Snapping.js +57 -0
  170. package/Source/Scene/SpzDecoder.js +106 -0
  171. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  172. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  173. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  174. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  175. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  178. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  179. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  180. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  181. package/Source/Shaders/GlobeFS.glsl +10 -9
  182. package/Source/Shaders/GlobeFS.js +11 -9
  183. package/Source/Shaders/GlobeVS.glsl +0 -32
  184. package/Source/Shaders/GlobeVS.js +0 -32
  185. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  186. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  187. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  188. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  189. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  190. package/Source/Shaders/Model/ModelFS.js +4 -0
  191. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  192. package/Source/Shaders/Model/ModelVS.js +7 -2
  193. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  194. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  195. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  196. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  197. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  198. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  199. package/Source/Shaders/VectorCommon.glsl +177 -50
  200. package/Source/Shaders/VectorCommon.js +251 -19
  201. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  202. package/Source/ThirdParty/zip-module.wasm +0 -0
  203. package/Source/Workers/createTaskProcessorWorker.js +2 -0
  204. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
  205. package/Source/Workers/decodeDraco.js +7 -3
  206. package/Source/Workers/decodeI3S.js +7 -3
  207. package/Source/Workers/decodeMeshopt.js +21 -0
  208. package/Source/Workers/decodeSpz.js +20 -0
  209. package/Source/Workers/gaussianSplatSorter.js +7 -3
  210. package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
  211. package/Source/Workers/transcodeKTX2.js +22 -5
  212. package/index.d.ts +649 -55
  213. package/index.js +23 -13
  214. package/package.json +6 -6
  215. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  216. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  217. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  218. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  219. package/Build/Workers/chunk-36NI5E6W.js +0 -3820
  220. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  221. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  222. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  223. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  224. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  225. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  226. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  227. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  228. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  229. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  230. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  231. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  232. package/Build/Workers/chunk-5YPQBFRD.js +0 -519
  233. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  234. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  235. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  236. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  237. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  238. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  239. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  240. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  241. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  242. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  243. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  244. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  245. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  246. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  247. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  248. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  249. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  250. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  251. package/Build/Workers/chunk-AHWAZRBV.js +0 -82
  252. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  253. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  254. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  255. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  256. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  257. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  258. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  259. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  260. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  261. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  262. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  263. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  264. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  265. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  266. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  267. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  268. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  269. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  270. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  271. package/Build/Workers/chunk-EOWDZN5S.js +0 -288
  272. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  273. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  274. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  275. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  276. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  277. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  278. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  279. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  280. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  281. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  282. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  283. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  284. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  285. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  286. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  287. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  288. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  289. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  290. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  291. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  292. package/Build/Workers/chunk-ILME5BXA.js +0 -301
  293. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  294. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  295. package/Build/Workers/chunk-J73T2VOY.js +0 -171
  296. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  297. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  298. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  299. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  300. package/Build/Workers/chunk-KMV25A63.js +0 -789
  301. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  302. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  303. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  304. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  305. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  306. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  307. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  308. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  309. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  310. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  311. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  312. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  313. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  314. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  315. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  316. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  317. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  318. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  319. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  320. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  321. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  322. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  323. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  324. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  325. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  326. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  327. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  328. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  329. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  330. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  331. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  332. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  333. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  334. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  335. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  336. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  337. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  338. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  339. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  340. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  341. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  342. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  343. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  344. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  345. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  346. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  347. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  348. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  349. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  350. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  351. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  352. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  353. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  354. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  355. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  356. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  357. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  358. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  359. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  360. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  361. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  362. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  363. package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
  364. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  365. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  366. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  367. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  368. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  369. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  370. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  371. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  372. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  373. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  374. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  375. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  376. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  377. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  378. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  379. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  380. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  381. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  382. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  383. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  384. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  385. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  386. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  387. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  388. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  389. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  390. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  391. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  392. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  393. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -1,1344 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.143.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
- Interval_default
28
- } from "./chunk-6R5X2GUA.js";
29
- import {
30
- Cartographic_default
31
- } from "./chunk-UTB7U3O6.js";
32
- import {
33
- Cartesian3_default,
34
- Matrix3_default
35
- } from "./chunk-ZQLZG4IN.js";
36
- import {
37
- Math_default
38
- } from "./chunk-5YPQBFRD.js";
39
- import {
40
- Check_default,
41
- DeveloperError_default
42
- } from "./chunk-6YR6JBMY.js";
43
- import {
44
- defined_default
45
- } from "./chunk-AHWAZRBV.js";
46
-
47
- // packages/engine/Source/Core/QuadraticRealPolynomial.js
48
- var QuadraticRealPolynomial = {};
49
- QuadraticRealPolynomial.computeDiscriminant = function(a, b, c) {
50
- if (typeof a !== "number") {
51
- throw new DeveloperError_default("a is a required number.");
52
- }
53
- if (typeof b !== "number") {
54
- throw new DeveloperError_default("b is a required number.");
55
- }
56
- if (typeof c !== "number") {
57
- throw new DeveloperError_default("c is a required number.");
58
- }
59
- const discriminant = b * b - 4 * a * c;
60
- return discriminant;
61
- };
62
- function addWithCancellationCheck(left, right, tolerance) {
63
- const difference = left + right;
64
- if (Math_default.sign(left) !== Math_default.sign(right) && Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance) {
65
- return 0;
66
- }
67
- return difference;
68
- }
69
- QuadraticRealPolynomial.computeRealRoots = function(a, b, c) {
70
- if (typeof a !== "number") {
71
- throw new DeveloperError_default("a is a required number.");
72
- }
73
- if (typeof b !== "number") {
74
- throw new DeveloperError_default("b is a required number.");
75
- }
76
- if (typeof c !== "number") {
77
- throw new DeveloperError_default("c is a required number.");
78
- }
79
- let ratio;
80
- if (a === 0) {
81
- if (b === 0) {
82
- return [];
83
- }
84
- return [-c / b];
85
- } else if (b === 0) {
86
- if (c === 0) {
87
- return [0, 0];
88
- }
89
- const cMagnitude = Math.abs(c);
90
- const aMagnitude = Math.abs(a);
91
- if (cMagnitude < aMagnitude && cMagnitude / aMagnitude < Math_default.EPSILON14) {
92
- return [0, 0];
93
- } else if (cMagnitude > aMagnitude && aMagnitude / cMagnitude < Math_default.EPSILON14) {
94
- return [];
95
- }
96
- ratio = -c / a;
97
- if (ratio < 0) {
98
- return [];
99
- }
100
- const root = Math.sqrt(ratio);
101
- return [-root, root];
102
- } else if (c === 0) {
103
- ratio = -b / a;
104
- if (ratio < 0) {
105
- return [ratio, 0];
106
- }
107
- return [0, ratio];
108
- }
109
- const b2 = b * b;
110
- const four_ac = 4 * a * c;
111
- const radicand = addWithCancellationCheck(b2, -four_ac, Math_default.EPSILON14);
112
- if (radicand < 0) {
113
- return [];
114
- }
115
- const q = -0.5 * addWithCancellationCheck(
116
- b,
117
- Math_default.sign(b) * Math.sqrt(radicand),
118
- Math_default.EPSILON14
119
- );
120
- if (b > 0) {
121
- return [q / a, c / q];
122
- }
123
- return [c / q, q / a];
124
- };
125
- var QuadraticRealPolynomial_default = QuadraticRealPolynomial;
126
-
127
- // packages/engine/Source/Core/CubicRealPolynomial.js
128
- var CubicRealPolynomial = {};
129
- CubicRealPolynomial.computeDiscriminant = function(a, b, c, d) {
130
- if (typeof a !== "number") {
131
- throw new DeveloperError_default("a is a required number.");
132
- }
133
- if (typeof b !== "number") {
134
- throw new DeveloperError_default("b is a required number.");
135
- }
136
- if (typeof c !== "number") {
137
- throw new DeveloperError_default("c is a required number.");
138
- }
139
- if (typeof d !== "number") {
140
- throw new DeveloperError_default("d is a required number.");
141
- }
142
- const a2 = a * a;
143
- const b2 = b * b;
144
- const c2 = c * c;
145
- const d2 = d * d;
146
- const discriminant = 18 * a * b * c * d + b2 * c2 - 27 * a2 * d2 - 4 * (a * c2 * c + b2 * b * d);
147
- return discriminant;
148
- };
149
- function computeRealRoots(a, b, c, d) {
150
- const A = a;
151
- const B = b / 3;
152
- const C = c / 3;
153
- const D = d;
154
- const AC = A * C;
155
- const BD = B * D;
156
- const B2 = B * B;
157
- const C2 = C * C;
158
- const delta1 = A * C - B2;
159
- const delta2 = A * D - B * C;
160
- const delta3 = B * D - C2;
161
- const discriminant = 4 * delta1 * delta3 - delta2 * delta2;
162
- let temp;
163
- let temp1;
164
- if (discriminant < 0) {
165
- let ABar;
166
- let CBar;
167
- let DBar;
168
- if (B2 * BD >= AC * C2) {
169
- ABar = A;
170
- CBar = delta1;
171
- DBar = -2 * B * delta1 + A * delta2;
172
- } else {
173
- ABar = D;
174
- CBar = delta3;
175
- DBar = -D * delta2 + 2 * C * delta3;
176
- }
177
- const s = DBar < 0 ? -1 : 1;
178
- const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);
179
- temp1 = -DBar + temp0;
180
- const x = temp1 / 2;
181
- const p = x < 0 ? -Math.pow(-x, 1 / 3) : Math.pow(x, 1 / 3);
182
- const q = temp1 === temp0 ? -p : -CBar / p;
183
- temp = CBar <= 0 ? p + q : -DBar / (p * p + q * q + CBar);
184
- if (B2 * BD >= AC * C2) {
185
- return [(temp - B) / A];
186
- }
187
- return [-D / (temp + C)];
188
- }
189
- const CBarA = delta1;
190
- const DBarA = -2 * B * delta1 + A * delta2;
191
- const CBarD = delta3;
192
- const DBarD = -D * delta2 + 2 * C * delta3;
193
- const squareRootOfDiscriminant = Math.sqrt(discriminant);
194
- const halfSquareRootOf3 = Math.sqrt(3) / 2;
195
- let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3);
196
- temp = 2 * Math.sqrt(-CBarA);
197
- let cosine = Math.cos(theta);
198
- temp1 = temp * cosine;
199
- let temp3 = temp * (-cosine / 2 - halfSquareRootOf3 * Math.sin(theta));
200
- const numeratorLarge = temp1 + temp3 > 2 * B ? temp1 - B : temp3 - B;
201
- const denominatorLarge = A;
202
- const root1 = numeratorLarge / denominatorLarge;
203
- theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3);
204
- temp = 2 * Math.sqrt(-CBarD);
205
- cosine = Math.cos(theta);
206
- temp1 = temp * cosine;
207
- temp3 = temp * (-cosine / 2 - halfSquareRootOf3 * Math.sin(theta));
208
- const numeratorSmall = -D;
209
- const denominatorSmall = temp1 + temp3 < 2 * C ? temp1 + C : temp3 + C;
210
- const root3 = numeratorSmall / denominatorSmall;
211
- const E = denominatorLarge * denominatorSmall;
212
- const F = -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;
213
- const G = numeratorLarge * numeratorSmall;
214
- const root2 = (C * F - B * G) / (-B * F + C * E);
215
- if (root1 <= root2) {
216
- if (root1 <= root3) {
217
- if (root2 <= root3) {
218
- return [root1, root2, root3];
219
- }
220
- return [root1, root3, root2];
221
- }
222
- return [root3, root1, root2];
223
- }
224
- if (root1 <= root3) {
225
- return [root2, root1, root3];
226
- }
227
- if (root2 <= root3) {
228
- return [root2, root3, root1];
229
- }
230
- return [root3, root2, root1];
231
- }
232
- CubicRealPolynomial.computeRealRoots = function(a, b, c, d) {
233
- if (typeof a !== "number") {
234
- throw new DeveloperError_default("a is a required number.");
235
- }
236
- if (typeof b !== "number") {
237
- throw new DeveloperError_default("b is a required number.");
238
- }
239
- if (typeof c !== "number") {
240
- throw new DeveloperError_default("c is a required number.");
241
- }
242
- if (typeof d !== "number") {
243
- throw new DeveloperError_default("d is a required number.");
244
- }
245
- let roots;
246
- let ratio;
247
- if (a === 0) {
248
- return QuadraticRealPolynomial_default.computeRealRoots(b, c, d);
249
- } else if (b === 0) {
250
- if (c === 0) {
251
- if (d === 0) {
252
- return [0, 0, 0];
253
- }
254
- ratio = -d / a;
255
- const root = ratio < 0 ? -Math.pow(-ratio, 1 / 3) : Math.pow(ratio, 1 / 3);
256
- return [root, root, root];
257
- } else if (d === 0) {
258
- roots = QuadraticRealPolynomial_default.computeRealRoots(a, 0, c);
259
- if (roots.Length === 0) {
260
- return [0];
261
- }
262
- return [roots[0], 0, roots[1]];
263
- }
264
- return computeRealRoots(a, 0, c, d);
265
- } else if (c === 0) {
266
- if (d === 0) {
267
- ratio = -b / a;
268
- if (ratio < 0) {
269
- return [ratio, 0, 0];
270
- }
271
- return [0, 0, ratio];
272
- }
273
- return computeRealRoots(a, b, 0, d);
274
- } else if (d === 0) {
275
- roots = QuadraticRealPolynomial_default.computeRealRoots(a, b, c);
276
- if (roots.length === 0) {
277
- return [0];
278
- } else if (roots[1] <= 0) {
279
- return [roots[0], roots[1], 0];
280
- } else if (roots[0] >= 0) {
281
- return [0, roots[0], roots[1]];
282
- }
283
- return [roots[0], 0, roots[1]];
284
- }
285
- return computeRealRoots(a, b, c, d);
286
- };
287
- var CubicRealPolynomial_default = CubicRealPolynomial;
288
-
289
- // packages/engine/Source/Core/QuarticRealPolynomial.js
290
- var QuarticRealPolynomial = {};
291
- QuarticRealPolynomial.computeDiscriminant = function(a, b, c, d, e) {
292
- if (typeof a !== "number") {
293
- throw new DeveloperError_default("a is a required number.");
294
- }
295
- if (typeof b !== "number") {
296
- throw new DeveloperError_default("b is a required number.");
297
- }
298
- if (typeof c !== "number") {
299
- throw new DeveloperError_default("c is a required number.");
300
- }
301
- if (typeof d !== "number") {
302
- throw new DeveloperError_default("d is a required number.");
303
- }
304
- if (typeof e !== "number") {
305
- throw new DeveloperError_default("e is a required number.");
306
- }
307
- const a2 = a * a;
308
- const a3 = a2 * a;
309
- const b2 = b * b;
310
- const b3 = b2 * b;
311
- const c2 = c * c;
312
- const c3 = c2 * c;
313
- const d2 = d * d;
314
- const d3 = d2 * d;
315
- const e2 = e * e;
316
- const e3 = e2 * e;
317
- const discriminant = b2 * c2 * d2 - 4 * b3 * d3 - 4 * a * c3 * d2 + 18 * a * b * c * d3 - 27 * a2 * d2 * d2 + 256 * a3 * e3 + e * (18 * b3 * c * d - 4 * b2 * c3 + 16 * a * c2 * c2 - 80 * a * b * c2 * d - 6 * a * b2 * d2 + 144 * a2 * c * d2) + e2 * (144 * a * b2 * c - 27 * b2 * b2 - 128 * a2 * c2 - 192 * a2 * b * d);
318
- return discriminant;
319
- };
320
- function original(a3, a2, a1, a0) {
321
- const a3Squared = a3 * a3;
322
- const p = a2 - 3 * a3Squared / 8;
323
- const q = a1 - a2 * a3 / 2 + a3Squared * a3 / 8;
324
- const r = a0 - a1 * a3 / 4 + a2 * a3Squared / 16 - 3 * a3Squared * a3Squared / 256;
325
- const cubicRoots = CubicRealPolynomial_default.computeRealRoots(
326
- 1,
327
- 2 * p,
328
- p * p - 4 * r,
329
- -q * q
330
- );
331
- if (cubicRoots.length > 0) {
332
- const temp = -a3 / 4;
333
- const hSquared = cubicRoots[cubicRoots.length - 1];
334
- if (Math.abs(hSquared) < Math_default.EPSILON14) {
335
- const roots = QuadraticRealPolynomial_default.computeRealRoots(1, p, r);
336
- if (roots.length === 2) {
337
- const root0 = roots[0];
338
- const root1 = roots[1];
339
- let y;
340
- if (root0 >= 0 && root1 >= 0) {
341
- const y0 = Math.sqrt(root0);
342
- const y1 = Math.sqrt(root1);
343
- return [temp - y1, temp - y0, temp + y0, temp + y1];
344
- } else if (root0 >= 0 && root1 < 0) {
345
- y = Math.sqrt(root0);
346
- return [temp - y, temp + y];
347
- } else if (root0 < 0 && root1 >= 0) {
348
- y = Math.sqrt(root1);
349
- return [temp - y, temp + y];
350
- }
351
- }
352
- return [];
353
- } else if (hSquared > 0) {
354
- const h = Math.sqrt(hSquared);
355
- const m = (p + hSquared - q / h) / 2;
356
- const n = (p + hSquared + q / h) / 2;
357
- const roots1 = QuadraticRealPolynomial_default.computeRealRoots(1, h, m);
358
- const roots2 = QuadraticRealPolynomial_default.computeRealRoots(1, -h, n);
359
- if (roots1.length !== 0) {
360
- roots1[0] += temp;
361
- roots1[1] += temp;
362
- if (roots2.length !== 0) {
363
- roots2[0] += temp;
364
- roots2[1] += temp;
365
- if (roots1[1] <= roots2[0]) {
366
- return [roots1[0], roots1[1], roots2[0], roots2[1]];
367
- } else if (roots2[1] <= roots1[0]) {
368
- return [roots2[0], roots2[1], roots1[0], roots1[1]];
369
- } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
370
- return [roots2[0], roots1[0], roots1[1], roots2[1]];
371
- } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
372
- return [roots1[0], roots2[0], roots2[1], roots1[1]];
373
- } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
374
- return [roots2[0], roots1[0], roots2[1], roots1[1]];
375
- }
376
- return [roots1[0], roots2[0], roots1[1], roots2[1]];
377
- }
378
- return roots1;
379
- }
380
- if (roots2.length !== 0) {
381
- roots2[0] += temp;
382
- roots2[1] += temp;
383
- return roots2;
384
- }
385
- return [];
386
- }
387
- }
388
- return [];
389
- }
390
- function neumark(a3, a2, a1, a0) {
391
- const a1Squared = a1 * a1;
392
- const a2Squared = a2 * a2;
393
- const a3Squared = a3 * a3;
394
- const p = -2 * a2;
395
- const q = a1 * a3 + a2Squared - 4 * a0;
396
- const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;
397
- const cubicRoots = CubicRealPolynomial_default.computeRealRoots(1, p, q, r);
398
- if (cubicRoots.length > 0) {
399
- const y = cubicRoots[0];
400
- const temp = a2 - y;
401
- const tempSquared = temp * temp;
402
- const g1 = a3 / 2;
403
- const h1 = temp / 2;
404
- const m = tempSquared - 4 * a0;
405
- const mError = tempSquared + 4 * Math.abs(a0);
406
- const n = a3Squared - 4 * y;
407
- const nError = a3Squared + 4 * Math.abs(y);
408
- let g2;
409
- let h2;
410
- if (y < 0 || m * nError < n * mError) {
411
- const squareRootOfN = Math.sqrt(n);
412
- g2 = squareRootOfN / 2;
413
- h2 = squareRootOfN === 0 ? 0 : (a3 * h1 - a1) / squareRootOfN;
414
- } else {
415
- const squareRootOfM = Math.sqrt(m);
416
- g2 = squareRootOfM === 0 ? 0 : (a3 * h1 - a1) / squareRootOfM;
417
- h2 = squareRootOfM / 2;
418
- }
419
- let G;
420
- let g;
421
- if (g1 === 0 && g2 === 0) {
422
- G = 0;
423
- g = 0;
424
- } else if (Math_default.sign(g1) === Math_default.sign(g2)) {
425
- G = g1 + g2;
426
- g = y / G;
427
- } else {
428
- g = g1 - g2;
429
- G = y / g;
430
- }
431
- let H;
432
- let h;
433
- if (h1 === 0 && h2 === 0) {
434
- H = 0;
435
- h = 0;
436
- } else if (Math_default.sign(h1) === Math_default.sign(h2)) {
437
- H = h1 + h2;
438
- h = a0 / H;
439
- } else {
440
- h = h1 - h2;
441
- H = a0 / h;
442
- }
443
- const roots1 = QuadraticRealPolynomial_default.computeRealRoots(1, G, H);
444
- const roots2 = QuadraticRealPolynomial_default.computeRealRoots(1, g, h);
445
- if (roots1.length !== 0) {
446
- if (roots2.length !== 0) {
447
- if (roots1[1] <= roots2[0]) {
448
- return [roots1[0], roots1[1], roots2[0], roots2[1]];
449
- } else if (roots2[1] <= roots1[0]) {
450
- return [roots2[0], roots2[1], roots1[0], roots1[1]];
451
- } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
452
- return [roots2[0], roots1[0], roots1[1], roots2[1]];
453
- } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
454
- return [roots1[0], roots2[0], roots2[1], roots1[1]];
455
- } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
456
- return [roots2[0], roots1[0], roots2[1], roots1[1]];
457
- }
458
- return [roots1[0], roots2[0], roots1[1], roots2[1]];
459
- }
460
- return roots1;
461
- }
462
- if (roots2.length !== 0) {
463
- return roots2;
464
- }
465
- }
466
- return [];
467
- }
468
- QuarticRealPolynomial.computeRealRoots = function(a, b, c, d, e) {
469
- if (typeof a !== "number") {
470
- throw new DeveloperError_default("a is a required number.");
471
- }
472
- if (typeof b !== "number") {
473
- throw new DeveloperError_default("b is a required number.");
474
- }
475
- if (typeof c !== "number") {
476
- throw new DeveloperError_default("c is a required number.");
477
- }
478
- if (typeof d !== "number") {
479
- throw new DeveloperError_default("d is a required number.");
480
- }
481
- if (typeof e !== "number") {
482
- throw new DeveloperError_default("e is a required number.");
483
- }
484
- if (Math.abs(a) < Math_default.EPSILON15) {
485
- return CubicRealPolynomial_default.computeRealRoots(b, c, d, e);
486
- }
487
- const a3 = b / a;
488
- const a2 = c / a;
489
- const a1 = d / a;
490
- const a0 = e / a;
491
- let k = a3 < 0 ? 1 : 0;
492
- k += a2 < 0 ? k + 1 : k;
493
- k += a1 < 0 ? k + 1 : k;
494
- k += a0 < 0 ? k + 1 : k;
495
- switch (k) {
496
- case 0:
497
- return original(a3, a2, a1, a0);
498
- case 1:
499
- return neumark(a3, a2, a1, a0);
500
- case 2:
501
- return neumark(a3, a2, a1, a0);
502
- case 3:
503
- return original(a3, a2, a1, a0);
504
- case 4:
505
- return original(a3, a2, a1, a0);
506
- case 5:
507
- return neumark(a3, a2, a1, a0);
508
- case 6:
509
- return original(a3, a2, a1, a0);
510
- case 7:
511
- return original(a3, a2, a1, a0);
512
- case 8:
513
- return neumark(a3, a2, a1, a0);
514
- case 9:
515
- return original(a3, a2, a1, a0);
516
- case 10:
517
- return original(a3, a2, a1, a0);
518
- case 11:
519
- return neumark(a3, a2, a1, a0);
520
- case 12:
521
- return original(a3, a2, a1, a0);
522
- case 13:
523
- return original(a3, a2, a1, a0);
524
- case 14:
525
- return original(a3, a2, a1, a0);
526
- case 15:
527
- return original(a3, a2, a1, a0);
528
- default:
529
- return void 0;
530
- }
531
- };
532
- var QuarticRealPolynomial_default = QuarticRealPolynomial;
533
-
534
- // packages/engine/Source/Core/Ray.js
535
- var Ray = class _Ray {
536
- /**
537
- * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.
538
- * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.
539
- */
540
- constructor(origin, direction) {
541
- direction = Cartesian3_default.clone(direction ?? Cartesian3_default.ZERO);
542
- if (!Cartesian3_default.equals(direction, Cartesian3_default.ZERO)) {
543
- Cartesian3_default.normalize(direction, direction);
544
- }
545
- this.origin = Cartesian3_default.clone(origin ?? Cartesian3_default.ZERO);
546
- this.direction = direction;
547
- }
548
- /**
549
- * Duplicates a Ray instance.
550
- *
551
- * @param {Ray} ray The ray to duplicate.
552
- * @param {Ray} [result] The object onto which to store the result.
553
- * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
554
- */
555
- static clone(ray, result) {
556
- if (!defined_default(ray)) {
557
- return void 0;
558
- }
559
- if (!defined_default(result)) {
560
- return new _Ray(ray.origin, ray.direction);
561
- }
562
- result.origin = Cartesian3_default.clone(ray.origin);
563
- result.direction = Cartesian3_default.clone(ray.direction);
564
- return result;
565
- }
566
- /**
567
- * Computes the point along the ray given by r(t) = o + t*d,
568
- * where o is the origin of the ray and d is the direction.
569
- *
570
- * @param {Ray} ray The ray.
571
- * @param {number} t A scalar value.
572
- * @param {Cartesian3} [result] The object in which the result will be stored.
573
- * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.
574
- *
575
- * @example
576
- * //Get the first intersection point of a ray and an ellipsoid.
577
- * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
578
- * const point = Cesium.Ray.getPoint(ray, intersection.start);
579
- */
580
- static getPoint(ray, t, result) {
581
- Check_default.typeOf.object("ray", ray);
582
- Check_default.typeOf.number("t", t);
583
- if (!defined_default(result)) {
584
- result = new Cartesian3_default();
585
- }
586
- result = Cartesian3_default.multiplyByScalar(ray.direction, t, result);
587
- return Cartesian3_default.add(ray.origin, result, result);
588
- }
589
- };
590
- var Ray_default = Ray;
591
-
592
- // packages/engine/Source/Core/IntersectionTests.js
593
- var IntersectionTests = {};
594
- IntersectionTests.rayPlane = function(ray, plane, result) {
595
- if (!defined_default(ray)) {
596
- throw new DeveloperError_default("ray is required.");
597
- }
598
- if (!defined_default(plane)) {
599
- throw new DeveloperError_default("plane is required.");
600
- }
601
- if (!defined_default(result)) {
602
- result = new Cartesian3_default();
603
- }
604
- const origin = ray.origin;
605
- const direction = ray.direction;
606
- const normal = plane.normal;
607
- const denominator = Cartesian3_default.dot(normal, direction);
608
- if (Math.abs(denominator) < Math_default.EPSILON15) {
609
- return void 0;
610
- }
611
- const t = (-plane.distance - Cartesian3_default.dot(normal, origin)) / denominator;
612
- if (t < 0) {
613
- return void 0;
614
- }
615
- result = Cartesian3_default.multiplyByScalar(direction, t, result);
616
- return Cartesian3_default.add(origin, result, result);
617
- };
618
- var scratchEdge0 = new Cartesian3_default();
619
- var scratchEdge1 = new Cartesian3_default();
620
- var scratchPVec = new Cartesian3_default();
621
- var scratchTVec = new Cartesian3_default();
622
- var scratchQVec = new Cartesian3_default();
623
- IntersectionTests.rayTriangleParametric = function(ray, p0, p1, p2, cullBackFaces) {
624
- if (!defined_default(ray)) {
625
- throw new DeveloperError_default("ray is required.");
626
- }
627
- if (!defined_default(p0)) {
628
- throw new DeveloperError_default("p0 is required.");
629
- }
630
- if (!defined_default(p1)) {
631
- throw new DeveloperError_default("p1 is required.");
632
- }
633
- if (!defined_default(p2)) {
634
- throw new DeveloperError_default("p2 is required.");
635
- }
636
- cullBackFaces = cullBackFaces ?? false;
637
- const origin = ray.origin;
638
- const direction = ray.direction;
639
- const edge0 = Cartesian3_default.subtract(p1, p0, scratchEdge0);
640
- const edge1 = Cartesian3_default.subtract(p2, p0, scratchEdge1);
641
- const p = Cartesian3_default.cross(direction, edge1, scratchPVec);
642
- const det = Cartesian3_default.dot(edge0, p);
643
- let tvec;
644
- let q;
645
- let u;
646
- let v;
647
- let t;
648
- if (cullBackFaces) {
649
- if (det < Math_default.EPSILON6) {
650
- return void 0;
651
- }
652
- tvec = Cartesian3_default.subtract(origin, p0, scratchTVec);
653
- u = Cartesian3_default.dot(tvec, p);
654
- if (u < 0 || u > det) {
655
- return void 0;
656
- }
657
- q = Cartesian3_default.cross(tvec, edge0, scratchQVec);
658
- v = Cartesian3_default.dot(direction, q);
659
- if (v < 0 || u + v > det) {
660
- return void 0;
661
- }
662
- t = Cartesian3_default.dot(edge1, q) / det;
663
- } else {
664
- if (Math.abs(det) < Math_default.EPSILON6) {
665
- return void 0;
666
- }
667
- const invDet = 1 / det;
668
- tvec = Cartesian3_default.subtract(origin, p0, scratchTVec);
669
- u = Cartesian3_default.dot(tvec, p) * invDet;
670
- if (u < 0 || u > 1) {
671
- return void 0;
672
- }
673
- q = Cartesian3_default.cross(tvec, edge0, scratchQVec);
674
- v = Cartesian3_default.dot(direction, q) * invDet;
675
- if (v < 0 || u + v > 1) {
676
- return void 0;
677
- }
678
- t = Cartesian3_default.dot(edge1, q) * invDet;
679
- }
680
- return t;
681
- };
682
- IntersectionTests.rayTriangle = function(ray, p0, p1, p2, cullBackFaces, result) {
683
- const t = IntersectionTests.rayTriangleParametric(
684
- ray,
685
- p0,
686
- p1,
687
- p2,
688
- cullBackFaces
689
- );
690
- if (!defined_default(t) || t < 0) {
691
- return void 0;
692
- }
693
- if (!defined_default(result)) {
694
- result = new Cartesian3_default();
695
- }
696
- Cartesian3_default.multiplyByScalar(ray.direction, t, result);
697
- return Cartesian3_default.add(ray.origin, result, result);
698
- };
699
- var scratchLineSegmentTriangleRay = new Ray_default();
700
- IntersectionTests.lineSegmentTriangle = function(v0, v1, p0, p1, p2, cullBackFaces, result) {
701
- if (!defined_default(v0)) {
702
- throw new DeveloperError_default("v0 is required.");
703
- }
704
- if (!defined_default(v1)) {
705
- throw new DeveloperError_default("v1 is required.");
706
- }
707
- if (!defined_default(p0)) {
708
- throw new DeveloperError_default("p0 is required.");
709
- }
710
- if (!defined_default(p1)) {
711
- throw new DeveloperError_default("p1 is required.");
712
- }
713
- if (!defined_default(p2)) {
714
- throw new DeveloperError_default("p2 is required.");
715
- }
716
- const ray = scratchLineSegmentTriangleRay;
717
- Cartesian3_default.clone(v0, ray.origin);
718
- Cartesian3_default.subtract(v1, v0, ray.direction);
719
- Cartesian3_default.normalize(ray.direction, ray.direction);
720
- const t = IntersectionTests.rayTriangleParametric(
721
- ray,
722
- p0,
723
- p1,
724
- p2,
725
- cullBackFaces
726
- );
727
- if (!defined_default(t) || t < 0 || t > Cartesian3_default.distance(v0, v1)) {
728
- return void 0;
729
- }
730
- if (!defined_default(result)) {
731
- result = new Cartesian3_default();
732
- }
733
- Cartesian3_default.multiplyByScalar(ray.direction, t, result);
734
- return Cartesian3_default.add(ray.origin, result, result);
735
- };
736
- function solveQuadratic(a, b, c, result) {
737
- const det = b * b - 4 * a * c;
738
- if (det < 0) {
739
- return void 0;
740
- } else if (det > 0) {
741
- const denom = 1 / (2 * a);
742
- const disc = Math.sqrt(det);
743
- const root0 = (-b + disc) * denom;
744
- const root1 = (-b - disc) * denom;
745
- if (root0 < root1) {
746
- result.root0 = root0;
747
- result.root1 = root1;
748
- } else {
749
- result.root0 = root1;
750
- result.root1 = root0;
751
- }
752
- return result;
753
- }
754
- const root = -b / (2 * a);
755
- if (root === 0) {
756
- return void 0;
757
- }
758
- result.root0 = result.root1 = root;
759
- return result;
760
- }
761
- var raySphereRoots = {
762
- root0: 0,
763
- root1: 0
764
- };
765
- function raySphere(ray, sphere, result) {
766
- if (!defined_default(result)) {
767
- result = new Interval_default();
768
- }
769
- const origin = ray.origin;
770
- const direction = ray.direction;
771
- const center = sphere.center;
772
- const radiusSquared = sphere.radius * sphere.radius;
773
- const diff = Cartesian3_default.subtract(origin, center, scratchPVec);
774
- const a = Cartesian3_default.dot(direction, direction);
775
- const b = 2 * Cartesian3_default.dot(direction, diff);
776
- const c = Cartesian3_default.magnitudeSquared(diff) - radiusSquared;
777
- const roots = solveQuadratic(a, b, c, raySphereRoots);
778
- if (!defined_default(roots)) {
779
- return void 0;
780
- }
781
- result.start = roots.root0;
782
- result.stop = roots.root1;
783
- return result;
784
- }
785
- IntersectionTests.raySphere = function(ray, sphere, result) {
786
- if (!defined_default(ray)) {
787
- throw new DeveloperError_default("ray is required.");
788
- }
789
- if (!defined_default(sphere)) {
790
- throw new DeveloperError_default("sphere is required.");
791
- }
792
- result = raySphere(ray, sphere, result);
793
- if (!defined_default(result) || result.stop < 0) {
794
- return void 0;
795
- }
796
- result.start = Math.max(result.start, 0);
797
- return result;
798
- };
799
- var scratchLineSegmentRay = new Ray_default();
800
- IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) {
801
- if (!defined_default(p0)) {
802
- throw new DeveloperError_default("p0 is required.");
803
- }
804
- if (!defined_default(p1)) {
805
- throw new DeveloperError_default("p1 is required.");
806
- }
807
- if (!defined_default(sphere)) {
808
- throw new DeveloperError_default("sphere is required.");
809
- }
810
- const ray = scratchLineSegmentRay;
811
- Cartesian3_default.clone(p0, ray.origin);
812
- const direction = Cartesian3_default.subtract(p1, p0, ray.direction);
813
- const maxT = Cartesian3_default.magnitude(direction);
814
- Cartesian3_default.normalize(direction, direction);
815
- result = raySphere(ray, sphere, result);
816
- if (!defined_default(result) || result.stop < 0 || result.start > maxT) {
817
- return void 0;
818
- }
819
- result.start = Math.max(result.start, 0);
820
- result.stop = Math.min(result.stop, maxT);
821
- return result;
822
- };
823
- var scratchQ = new Cartesian3_default();
824
- var scratchW = new Cartesian3_default();
825
- IntersectionTests.rayEllipsoid = function(ray, ellipsoid) {
826
- if (!defined_default(ray)) {
827
- throw new DeveloperError_default("ray is required.");
828
- }
829
- if (!defined_default(ellipsoid)) {
830
- throw new DeveloperError_default("ellipsoid is required.");
831
- }
832
- const inverseRadii = ellipsoid.oneOverRadii;
833
- const q = Cartesian3_default.multiplyComponents(inverseRadii, ray.origin, scratchQ);
834
- const w = Cartesian3_default.multiplyComponents(
835
- inverseRadii,
836
- ray.direction,
837
- scratchW
838
- );
839
- const q2 = Cartesian3_default.magnitudeSquared(q);
840
- const qw = Cartesian3_default.dot(q, w);
841
- let difference, w2, product, discriminant, temp;
842
- if (q2 > 1) {
843
- if (qw >= 0) {
844
- return void 0;
845
- }
846
- const qw2 = qw * qw;
847
- difference = q2 - 1;
848
- w2 = Cartesian3_default.magnitudeSquared(w);
849
- product = w2 * difference;
850
- if (qw2 < product) {
851
- return void 0;
852
- } else if (qw2 > product) {
853
- discriminant = qw * qw - product;
854
- temp = -qw + Math.sqrt(discriminant);
855
- const root0 = temp / w2;
856
- const root1 = difference / temp;
857
- if (root0 < root1) {
858
- return new Interval_default(root0, root1);
859
- }
860
- return {
861
- start: root1,
862
- stop: root0
863
- };
864
- }
865
- const root = Math.sqrt(difference / w2);
866
- return new Interval_default(root, root);
867
- } else if (q2 < 1) {
868
- difference = q2 - 1;
869
- w2 = Cartesian3_default.magnitudeSquared(w);
870
- product = w2 * difference;
871
- discriminant = qw * qw - product;
872
- temp = -qw + Math.sqrt(discriminant);
873
- return new Interval_default(0, temp / w2);
874
- }
875
- if (qw < 0) {
876
- w2 = Cartesian3_default.magnitudeSquared(w);
877
- return new Interval_default(0, -qw / w2);
878
- }
879
- return void 0;
880
- };
881
- var scratchRayIntervalX = new Interval_default();
882
- var scratchRayIntervalY = new Interval_default();
883
- var scratchRayIntervalZ = new Interval_default();
884
- IntersectionTests.rayAxisAlignedBoundingBox = function(ray, box, result) {
885
- if (!defined_default(ray)) {
886
- throw new DeveloperError_default("ray is required.");
887
- }
888
- if (!defined_default(box)) {
889
- throw new DeveloperError_default("box is required.");
890
- }
891
- if (!defined_default(result)) {
892
- result = new Interval_default();
893
- }
894
- const tx = rayIntervalAlongAABBAxis(
895
- ray.origin.x,
896
- ray.direction.x,
897
- box.minimum.x,
898
- box.maximum.x,
899
- scratchRayIntervalX
900
- );
901
- const ty = rayIntervalAlongAABBAxis(
902
- ray.origin.y,
903
- ray.direction.y,
904
- box.minimum.y,
905
- box.maximum.y,
906
- scratchRayIntervalY
907
- );
908
- const tz = rayIntervalAlongAABBAxis(
909
- ray.origin.z,
910
- ray.direction.z,
911
- box.minimum.z,
912
- box.maximum.z,
913
- scratchRayIntervalZ
914
- );
915
- result.start = tx.start > ty.start ? tx.start : ty.start;
916
- result.stop = tx.stop < ty.stop ? tx.stop : ty.stop;
917
- if (tx.start > ty.stop || ty.start > tx.stop) {
918
- return void 0;
919
- }
920
- if (result.start > tz.stop || tz.start > result.stop) {
921
- return void 0;
922
- }
923
- if (tz.start > result.start) {
924
- result.start = tz.start;
925
- }
926
- if (tz.stop < result.stop) {
927
- result.stop = tz.stop;
928
- }
929
- return result;
930
- };
931
- function rayIntervalAlongAABBAxis(origin, direction, min, max, result) {
932
- result.start = (min - origin) / direction;
933
- result.stop = (max - origin) / direction;
934
- if (result.stop < result.start) {
935
- const tmp = result.stop;
936
- result.stop = result.start;
937
- result.start = tmp;
938
- }
939
- return result;
940
- }
941
- function addWithCancellationCheck2(left, right, tolerance) {
942
- const difference = left + right;
943
- if (Math_default.sign(left) !== Math_default.sign(right) && Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance) {
944
- return 0;
945
- }
946
- return difference;
947
- }
948
- IntersectionTests.quadraticVectorExpression = function(A, b, c, x, w) {
949
- const xSquared = x * x;
950
- const wSquared = w * w;
951
- const l2 = (A[Matrix3_default.COLUMN1ROW1] - A[Matrix3_default.COLUMN2ROW2]) * wSquared;
952
- const l1 = w * (x * addWithCancellationCheck2(
953
- A[Matrix3_default.COLUMN1ROW0],
954
- A[Matrix3_default.COLUMN0ROW1],
955
- Math_default.EPSILON15
956
- ) + b.y);
957
- const l0 = A[Matrix3_default.COLUMN0ROW0] * xSquared + A[Matrix3_default.COLUMN2ROW2] * wSquared + x * b.x + c;
958
- const r1 = wSquared * addWithCancellationCheck2(
959
- A[Matrix3_default.COLUMN2ROW1],
960
- A[Matrix3_default.COLUMN1ROW2],
961
- Math_default.EPSILON15
962
- );
963
- const r0 = w * (x * addWithCancellationCheck2(A[Matrix3_default.COLUMN2ROW0], A[Matrix3_default.COLUMN0ROW2]) + b.z);
964
- let cosines;
965
- const solutions = [];
966
- if (r0 === 0 && r1 === 0) {
967
- cosines = QuadraticRealPolynomial_default.computeRealRoots(l2, l1, l0);
968
- if (cosines.length === 0) {
969
- return solutions;
970
- }
971
- const cosine0 = cosines[0];
972
- const sine0 = Math.sqrt(Math.max(1 - cosine0 * cosine0, 0));
973
- solutions.push(new Cartesian3_default(x, w * cosine0, w * -sine0));
974
- solutions.push(new Cartesian3_default(x, w * cosine0, w * sine0));
975
- if (cosines.length === 2) {
976
- const cosine1 = cosines[1];
977
- const sine1 = Math.sqrt(Math.max(1 - cosine1 * cosine1, 0));
978
- solutions.push(new Cartesian3_default(x, w * cosine1, w * -sine1));
979
- solutions.push(new Cartesian3_default(x, w * cosine1, w * sine1));
980
- }
981
- return solutions;
982
- }
983
- const r0Squared = r0 * r0;
984
- const r1Squared = r1 * r1;
985
- const l2Squared = l2 * l2;
986
- const r0r1 = r0 * r1;
987
- const c4 = l2Squared + r1Squared;
988
- const c3 = 2 * (l1 * l2 + r0r1);
989
- const c2 = 2 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;
990
- const c1 = 2 * (l0 * l1 - r0r1);
991
- const c0 = l0 * l0 - r0Squared;
992
- if (c4 === 0 && c3 === 0 && c2 === 0 && c1 === 0) {
993
- return solutions;
994
- }
995
- cosines = QuarticRealPolynomial_default.computeRealRoots(c4, c3, c2, c1, c0);
996
- const length = cosines.length;
997
- if (length === 0) {
998
- return solutions;
999
- }
1000
- for (let i = 0; i < length; ++i) {
1001
- const cosine = cosines[i];
1002
- const cosineSquared = cosine * cosine;
1003
- const sineSquared = Math.max(1 - cosineSquared, 0);
1004
- const sine = Math.sqrt(sineSquared);
1005
- let left;
1006
- if (Math_default.sign(l2) === Math_default.sign(l0)) {
1007
- left = addWithCancellationCheck2(
1008
- l2 * cosineSquared + l0,
1009
- l1 * cosine,
1010
- Math_default.EPSILON12
1011
- );
1012
- } else if (Math_default.sign(l0) === Math_default.sign(l1 * cosine)) {
1013
- left = addWithCancellationCheck2(
1014
- l2 * cosineSquared,
1015
- l1 * cosine + l0,
1016
- Math_default.EPSILON12
1017
- );
1018
- } else {
1019
- left = addWithCancellationCheck2(
1020
- l2 * cosineSquared + l1 * cosine,
1021
- l0,
1022
- Math_default.EPSILON12
1023
- );
1024
- }
1025
- const right = addWithCancellationCheck2(
1026
- r1 * cosine,
1027
- r0,
1028
- Math_default.EPSILON15
1029
- );
1030
- const product = left * right;
1031
- if (product < 0) {
1032
- solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
1033
- } else if (product > 0) {
1034
- solutions.push(new Cartesian3_default(x, w * cosine, w * -sine));
1035
- } else if (sine !== 0) {
1036
- solutions.push(new Cartesian3_default(x, w * cosine, w * -sine));
1037
- solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
1038
- ++i;
1039
- } else {
1040
- solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
1041
- }
1042
- }
1043
- return solutions;
1044
- };
1045
- var firstAxisScratch = new Cartesian3_default();
1046
- var secondAxisScratch = new Cartesian3_default();
1047
- var thirdAxisScratch = new Cartesian3_default();
1048
- var referenceScratch = new Cartesian3_default();
1049
- var bCart = new Cartesian3_default();
1050
- var bScratch = new Matrix3_default();
1051
- var btScratch = new Matrix3_default();
1052
- var diScratch = new Matrix3_default();
1053
- var dScratch = new Matrix3_default();
1054
- var cScratch = new Matrix3_default();
1055
- var tempMatrix = new Matrix3_default();
1056
- var aScratch = new Matrix3_default();
1057
- var sScratch = new Cartesian3_default();
1058
- var closestScratch = new Cartesian3_default();
1059
- var surfPointScratch = new Cartographic_default();
1060
- IntersectionTests.grazingAltitudeLocation = function(ray, ellipsoid) {
1061
- if (!defined_default(ray)) {
1062
- throw new DeveloperError_default("ray is required.");
1063
- }
1064
- if (!defined_default(ellipsoid)) {
1065
- throw new DeveloperError_default("ellipsoid is required.");
1066
- }
1067
- const position = ray.origin;
1068
- const direction = ray.direction;
1069
- if (!Cartesian3_default.equals(position, Cartesian3_default.ZERO)) {
1070
- const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);
1071
- if (Cartesian3_default.dot(direction, normal) >= 0) {
1072
- return position;
1073
- }
1074
- }
1075
- const intersects = defined_default(this.rayEllipsoid(ray, ellipsoid));
1076
- const f = ellipsoid.transformPositionToScaledSpace(
1077
- direction,
1078
- firstAxisScratch
1079
- );
1080
- const firstAxis = Cartesian3_default.normalize(f, f);
1081
- const reference = Cartesian3_default.mostOrthogonalAxis(f, referenceScratch);
1082
- const secondAxis = Cartesian3_default.normalize(
1083
- Cartesian3_default.cross(reference, firstAxis, secondAxisScratch),
1084
- secondAxisScratch
1085
- );
1086
- const thirdAxis = Cartesian3_default.normalize(
1087
- Cartesian3_default.cross(firstAxis, secondAxis, thirdAxisScratch),
1088
- thirdAxisScratch
1089
- );
1090
- const B = bScratch;
1091
- B[0] = firstAxis.x;
1092
- B[1] = firstAxis.y;
1093
- B[2] = firstAxis.z;
1094
- B[3] = secondAxis.x;
1095
- B[4] = secondAxis.y;
1096
- B[5] = secondAxis.z;
1097
- B[6] = thirdAxis.x;
1098
- B[7] = thirdAxis.y;
1099
- B[8] = thirdAxis.z;
1100
- const B_T = Matrix3_default.transpose(B, btScratch);
1101
- const D_I = Matrix3_default.fromScale(ellipsoid.radii, diScratch);
1102
- const D = Matrix3_default.fromScale(ellipsoid.oneOverRadii, dScratch);
1103
- const C = cScratch;
1104
- C[0] = 0;
1105
- C[1] = -direction.z;
1106
- C[2] = direction.y;
1107
- C[3] = direction.z;
1108
- C[4] = 0;
1109
- C[5] = -direction.x;
1110
- C[6] = -direction.y;
1111
- C[7] = direction.x;
1112
- C[8] = 0;
1113
- const temp = Matrix3_default.multiply(
1114
- Matrix3_default.multiply(B_T, D, tempMatrix),
1115
- C,
1116
- tempMatrix
1117
- );
1118
- const A = Matrix3_default.multiply(
1119
- Matrix3_default.multiply(temp, D_I, aScratch),
1120
- B,
1121
- aScratch
1122
- );
1123
- const b = Matrix3_default.multiplyByVector(temp, position, bCart);
1124
- const solutions = IntersectionTests.quadraticVectorExpression(
1125
- A,
1126
- Cartesian3_default.negate(b, firstAxisScratch),
1127
- 0,
1128
- 0,
1129
- 1
1130
- );
1131
- let s;
1132
- let altitude;
1133
- const length = solutions.length;
1134
- if (length > 0) {
1135
- let closest = Cartesian3_default.clone(Cartesian3_default.ZERO, closestScratch);
1136
- let maximumValue = Number.NEGATIVE_INFINITY;
1137
- for (let i = 0; i < length; ++i) {
1138
- s = Matrix3_default.multiplyByVector(
1139
- D_I,
1140
- Matrix3_default.multiplyByVector(B, solutions[i], sScratch),
1141
- sScratch
1142
- );
1143
- const v = Cartesian3_default.normalize(
1144
- Cartesian3_default.subtract(s, position, referenceScratch),
1145
- referenceScratch
1146
- );
1147
- const dotProduct = Cartesian3_default.dot(v, direction);
1148
- if (dotProduct > maximumValue) {
1149
- maximumValue = dotProduct;
1150
- closest = Cartesian3_default.clone(s, closest);
1151
- }
1152
- }
1153
- const surfacePoint = ellipsoid.cartesianToCartographic(
1154
- closest,
1155
- surfPointScratch
1156
- );
1157
- maximumValue = Math_default.clamp(maximumValue, 0, 1);
1158
- altitude = Cartesian3_default.magnitude(
1159
- Cartesian3_default.subtract(closest, position, referenceScratch)
1160
- ) * Math.sqrt(1 - maximumValue * maximumValue);
1161
- altitude = intersects ? -altitude : altitude;
1162
- surfacePoint.height = altitude;
1163
- return ellipsoid.cartographicToCartesian(surfacePoint, new Cartesian3_default());
1164
- }
1165
- return void 0;
1166
- };
1167
- var lineSegmentPlaneDifference = new Cartesian3_default();
1168
- IntersectionTests.lineSegmentPlane = function(endPoint0, endPoint1, plane, result) {
1169
- if (!defined_default(endPoint0)) {
1170
- throw new DeveloperError_default("endPoint0 is required.");
1171
- }
1172
- if (!defined_default(endPoint1)) {
1173
- throw new DeveloperError_default("endPoint1 is required.");
1174
- }
1175
- if (!defined_default(plane)) {
1176
- throw new DeveloperError_default("plane is required.");
1177
- }
1178
- if (!defined_default(result)) {
1179
- result = new Cartesian3_default();
1180
- }
1181
- const difference = Cartesian3_default.subtract(
1182
- endPoint1,
1183
- endPoint0,
1184
- lineSegmentPlaneDifference
1185
- );
1186
- const normal = plane.normal;
1187
- const nDotDiff = Cartesian3_default.dot(normal, difference);
1188
- if (Math.abs(nDotDiff) < Math_default.EPSILON6) {
1189
- return void 0;
1190
- }
1191
- const nDotP0 = Cartesian3_default.dot(normal, endPoint0);
1192
- const t = -(plane.distance + nDotP0) / nDotDiff;
1193
- if (t < 0 || t > 1) {
1194
- return void 0;
1195
- }
1196
- Cartesian3_default.multiplyByScalar(difference, t, result);
1197
- Cartesian3_default.add(endPoint0, result, result);
1198
- return result;
1199
- };
1200
- IntersectionTests.trianglePlaneIntersection = function(p0, p1, p2, plane) {
1201
- if (!defined_default(p0) || !defined_default(p1) || !defined_default(p2) || !defined_default(plane)) {
1202
- throw new DeveloperError_default("p0, p1, p2, and plane are required.");
1203
- }
1204
- const planeNormal = plane.normal;
1205
- const planeD = plane.distance;
1206
- const p0Behind = Cartesian3_default.dot(planeNormal, p0) + planeD < 0;
1207
- const p1Behind = Cartesian3_default.dot(planeNormal, p1) + planeD < 0;
1208
- const p2Behind = Cartesian3_default.dot(planeNormal, p2) + planeD < 0;
1209
- let numBehind = 0;
1210
- numBehind += p0Behind ? 1 : 0;
1211
- numBehind += p1Behind ? 1 : 0;
1212
- numBehind += p2Behind ? 1 : 0;
1213
- let u1, u2;
1214
- if (numBehind === 1 || numBehind === 2) {
1215
- u1 = new Cartesian3_default();
1216
- u2 = new Cartesian3_default();
1217
- }
1218
- if (numBehind === 1) {
1219
- if (p0Behind) {
1220
- IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);
1221
- IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);
1222
- return {
1223
- positions: [p0, p1, p2, u1, u2],
1224
- indices: [
1225
- // Behind
1226
- 0,
1227
- 3,
1228
- 4,
1229
- // In front
1230
- 1,
1231
- 2,
1232
- 4,
1233
- 1,
1234
- 4,
1235
- 3
1236
- ]
1237
- };
1238
- } else if (p1Behind) {
1239
- IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);
1240
- IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);
1241
- return {
1242
- positions: [p0, p1, p2, u1, u2],
1243
- indices: [
1244
- // Behind
1245
- 1,
1246
- 3,
1247
- 4,
1248
- // In front
1249
- 2,
1250
- 0,
1251
- 4,
1252
- 2,
1253
- 4,
1254
- 3
1255
- ]
1256
- };
1257
- } else if (p2Behind) {
1258
- IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);
1259
- IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);
1260
- return {
1261
- positions: [p0, p1, p2, u1, u2],
1262
- indices: [
1263
- // Behind
1264
- 2,
1265
- 3,
1266
- 4,
1267
- // In front
1268
- 0,
1269
- 1,
1270
- 4,
1271
- 0,
1272
- 4,
1273
- 3
1274
- ]
1275
- };
1276
- }
1277
- } else if (numBehind === 2) {
1278
- if (!p0Behind) {
1279
- IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);
1280
- IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);
1281
- return {
1282
- positions: [p0, p1, p2, u1, u2],
1283
- indices: [
1284
- // Behind
1285
- 1,
1286
- 2,
1287
- 4,
1288
- 1,
1289
- 4,
1290
- 3,
1291
- // In front
1292
- 0,
1293
- 3,
1294
- 4
1295
- ]
1296
- };
1297
- } else if (!p1Behind) {
1298
- IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);
1299
- IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);
1300
- return {
1301
- positions: [p0, p1, p2, u1, u2],
1302
- indices: [
1303
- // Behind
1304
- 2,
1305
- 0,
1306
- 4,
1307
- 2,
1308
- 4,
1309
- 3,
1310
- // In front
1311
- 1,
1312
- 3,
1313
- 4
1314
- ]
1315
- };
1316
- } else if (!p2Behind) {
1317
- IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);
1318
- IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);
1319
- return {
1320
- positions: [p0, p1, p2, u1, u2],
1321
- indices: [
1322
- // Behind
1323
- 0,
1324
- 1,
1325
- 4,
1326
- 0,
1327
- 4,
1328
- 3,
1329
- // In front
1330
- 2,
1331
- 3,
1332
- 4
1333
- ]
1334
- };
1335
- }
1336
- }
1337
- return void 0;
1338
- };
1339
- var IntersectionTests_default = IntersectionTests;
1340
-
1341
- export {
1342
- Ray_default,
1343
- IntersectionTests_default
1344
- };