@cesium/engine 26.2.0 → 26.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +656 -518
  2. package/Build/Workers/{chunk-FU4BGABC.js → chunk-2DKJSPYF.js} +14 -14
  3. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-2PWVICP6.js} +1 -1
  4. package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
  5. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-4DMAXPKB.js} +11 -11
  6. package/Build/Workers/{chunk-IMBVP57H.js → chunk-4LRFYRBX.js} +2 -2
  7. package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
  8. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
  9. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-6BSNYZZG.js} +5 -5
  10. package/Build/Workers/{chunk-D6AY775A.js → chunk-6R6SGKYN.js} +6 -6
  11. package/Build/Workers/{chunk-3PSS3T43.js → chunk-6V2KDEHL.js} +4 -4
  12. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-75BC2IHI.js} +7 -7
  13. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-7SESBH2I.js} +4 -4
  14. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-7WXBTNRV.js} +8 -8
  15. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-A7SMPV6B.js} +12 -12
  16. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-ATSXKJ3L.js} +7 -7
  17. package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
  18. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-B7Q2WF6Q.js} +4 -4
  19. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-BNDSDQ7D.js} +9 -9
  20. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-CKK6CUXK.js} +6 -6
  21. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
  22. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-CQ4TZXAT.js} +6 -6
  23. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-DKSANM4A.js} +12 -12
  24. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-DZK34ZVD.js} +1 -1
  25. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
  26. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
  27. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-F34TJJLA.js} +14 -14
  28. package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
  29. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-GS7RY2DH.js} +11 -11
  30. package/Build/Workers/{chunk-5YPQBFRD.js → chunk-HDD3RFLT.js} +3 -3
  31. package/Build/Workers/{chunk-36NI5E6W.js → chunk-HDPNFEPP.js} +18 -18
  32. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-JBJ6BRIM.js} +4 -4
  33. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-JKTWW7IO.js} +5 -5
  34. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-JL4NWWQY.js} +5 -5
  35. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-JMUUAW4X.js} +10 -10
  36. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-KBGAHN5R.js} +1 -1
  37. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-KEWK6VZL.js} +12 -12
  38. package/Build/Workers/{chunk-EOWDZN5S.js → chunk-L73K5UPP.js} +10 -10
  39. package/Build/Workers/{chunk-J73T2VOY.js → chunk-LL2SGJYH.js} +6 -6
  40. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-LYJUL4XQ.js} +6 -6
  41. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-M6W46OAP.js} +7 -7
  42. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-MDDKCLMF.js} +16 -16
  43. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-MUW4DJV7.js} +17 -17
  44. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-N5YK44FS.js} +5 -5
  45. package/Build/Workers/{chunk-27FWRTJI.js → chunk-NZQUP52G.js} +9 -9
  46. package/Build/Workers/{chunk-A62YI6S6.js → chunk-PKZA44LH.js} +4 -4
  47. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-Q2JS5LCB.js} +17 -17
  48. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
  49. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-SEJIXZZ4.js} +10 -10
  50. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-SL2HCFYW.js} +10 -10
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-SLHK3KAR.js} +5 -5
  52. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
  53. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-VRECSMG3.js} +2 -2
  54. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-X27HKF5E.js} +2 -2
  55. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-XBY3354M.js} +6 -6
  56. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-XRZCS3HE.js} +8 -8
  57. package/Build/Workers/{chunk-XLQZNQ4Z.js → chunk-XSIUYAT6.js} +2 -2
  58. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-Z2DW5NM2.js} +4 -4
  59. package/Build/Workers/combineGeometry.js +24 -24
  60. package/Build/Workers/createBoxGeometry.js +18 -18
  61. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  62. package/Build/Workers/createCircleGeometry.js +26 -26
  63. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  64. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  65. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  66. package/Build/Workers/createCorridorGeometry.js +29 -29
  67. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  68. package/Build/Workers/createCylinderGeometry.js +20 -20
  69. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  70. package/Build/Workers/createEllipseGeometry.js +26 -26
  71. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  73. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  74. package/Build/Workers/createFrustumGeometry.js +18 -18
  75. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  76. package/Build/Workers/createGeometry.js +24 -24
  77. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  78. package/Build/Workers/createPlaneGeometry.js +16 -16
  79. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  80. package/Build/Workers/createPolygonGeometry.js +32 -32
  81. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  82. package/Build/Workers/createPolylineGeometry.js +25 -25
  83. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  84. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  85. package/Build/Workers/createRectangleGeometry.js +27 -27
  86. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  87. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  88. package/Build/Workers/createSphereGeometry.js +19 -19
  89. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  90. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  91. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  92. package/Build/Workers/createVectorTileGeometries.js +24 -24
  93. package/Build/Workers/createVectorTilePoints.js +13 -13
  94. package/Build/Workers/createVectorTilePolygons.js +22 -22
  95. package/Build/Workers/createVectorTilePolylines.js +14 -14
  96. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  97. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  98. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  99. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  100. package/Build/Workers/createWallGeometry.js +24 -24
  101. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  102. package/Build/Workers/decodeDraco.js +10 -10
  103. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  104. package/Build/Workers/decodeI3S.js +10 -10
  105. package/Build/Workers/gaussianSplatSorter.js +4 -4
  106. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  107. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  108. package/Build/Workers/transcodeKTX2.js +6 -6
  109. package/Build/Workers/transferTypedArrayTest.js +1 -1
  110. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  111. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  112. package/Source/Core/Ion.js +1 -1
  113. package/Source/Core/IonResource.js +5 -0
  114. package/Source/Core/IonSnapGeometryType.js +59 -0
  115. package/Source/Core/IonSnapHeat.js +33 -0
  116. package/Source/Core/IonSnapMode.js +45 -0
  117. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  118. package/Source/Core/IonSnapService.js +369 -0
  119. package/Source/Core/SnapService.js +63 -0
  120. package/Source/Core/VectorPipeline.js +139 -45
  121. package/Source/Core/VectorProvider.js +311 -71
  122. package/Source/Renderer/AutomaticUniforms.js +44 -2
  123. package/Source/Renderer/ShaderBuilder.js +1 -1
  124. package/Source/Renderer/UniformState.js +47 -1
  125. package/Source/Scene/ArcGisMapService.js +1 -1
  126. package/Source/Scene/BufferPointCollection.js +4 -7
  127. package/Source/Scene/BufferPolygonCollection.js +56 -27
  128. package/Source/Scene/BufferPolylineCollection.js +61 -8
  129. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  130. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  131. package/Source/Scene/Cesium3DTile.js +12 -0
  132. package/Source/Scene/Cesium3DTileset.js +61 -8
  133. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  134. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  135. package/Source/Scene/ClippingPolygon.js +154 -100
  136. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  137. package/Source/Scene/CreditDisplay.js +62 -0
  138. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  139. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  140. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  141. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  142. package/Source/Scene/GltfLoader.js +56 -6
  143. package/Source/Scene/HeightReference.js +1 -1
  144. package/Source/Scene/MVTDataProvider.js +9 -0
  145. package/Source/Scene/Model/Model.js +242 -16
  146. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  147. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  148. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  149. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  150. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  151. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  152. package/Source/Scene/PostProcessStage.js +22 -3
  153. package/Source/Scene/Scene.js +56 -1
  154. package/Source/Scene/Snapping.js +57 -0
  155. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  156. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  157. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  158. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  159. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  160. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  161. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  162. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  163. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  164. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  165. package/Source/Shaders/GlobeFS.glsl +10 -9
  166. package/Source/Shaders/GlobeFS.js +11 -9
  167. package/Source/Shaders/GlobeVS.glsl +0 -32
  168. package/Source/Shaders/GlobeVS.js +0 -32
  169. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  170. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  171. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  172. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  173. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  174. package/Source/Shaders/Model/ModelFS.js +4 -0
  175. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  176. package/Source/Shaders/Model/ModelVS.js +7 -2
  177. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  178. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  179. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  180. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  181. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  182. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  183. package/Source/Shaders/VectorCommon.glsl +177 -50
  184. package/Source/Shaders/VectorCommon.js +251 -19
  185. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  186. package/index.d.ts +556 -55
  187. package/index.js +20 -13
  188. package/package.json +6 -6
  189. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  190. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  191. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  192. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  193. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  194. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  195. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  196. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  197. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  198. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  199. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  200. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  201. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  202. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  203. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  204. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  205. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  206. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  207. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  208. package/Build/Workers/chunk-6YR6JBMY.js +0 -163
  209. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  210. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  211. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  212. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  213. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  214. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  215. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  216. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  217. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  218. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  219. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  220. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  221. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  222. package/Build/Workers/chunk-ACTVJHSP.js +0 -519
  223. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  224. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  225. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  226. package/Build/Workers/chunk-ARZICEEP.js +0 -301
  227. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  228. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  229. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  230. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  231. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  232. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  233. package/Build/Workers/chunk-CDJDJ5LK.js +0 -44
  234. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  235. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  236. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  237. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  238. package/Build/Workers/chunk-CUTRKXUQ.js +0 -288
  239. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  240. package/Build/Workers/chunk-DIGUUD6G.js +0 -171
  241. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  242. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  243. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  244. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  245. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  246. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  247. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  248. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  249. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  250. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  251. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  252. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  253. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  254. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  255. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  256. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  257. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  258. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  259. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  260. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  261. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  262. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  263. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  264. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  265. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  266. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  267. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  268. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  269. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  270. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  271. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  272. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  273. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  274. package/Build/Workers/chunk-KMV25A63.js +0 -789
  275. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  276. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  277. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  278. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  279. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  280. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  281. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  282. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  283. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  284. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  285. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  286. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  287. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  288. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  289. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  290. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  291. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  292. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  293. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  294. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  295. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  296. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  297. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  298. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  299. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  300. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  301. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  302. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  303. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  304. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  305. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  306. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  307. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  308. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  309. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  310. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  311. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  312. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  313. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  314. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  315. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  316. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  317. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  318. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  319. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  320. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  321. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  322. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  323. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  324. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  325. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  326. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  327. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  328. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  329. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  330. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  331. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  332. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  333. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  334. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  335. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  336. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  337. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  338. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  339. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  340. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  341. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  342. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  343. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  344. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  345. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  346. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  347. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  348. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  349. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  350. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  351. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  352. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  353. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  354. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  355. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  356. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  357. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  358. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  359. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  360. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  361. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  362. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  363. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  364. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  365. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  366. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -1,1483 +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
- VertexFormat_default
28
- } from "./chunk-C7QDUNI3.js";
29
- import {
30
- Plane_default
31
- } from "./chunk-J73T2VOY.js";
32
- import {
33
- GeometryAttributes_default
34
- } from "./chunk-IMBVP57H.js";
35
- import {
36
- GeometryAttribute_default,
37
- Geometry_default,
38
- PrimitiveType_default
39
- } from "./chunk-ARZICEEP.js";
40
- import {
41
- BoundingSphere_default
42
- } from "./chunk-2RGJPWQX.js";
43
- import {
44
- Intersect_default
45
- } from "./chunk-JKXV6PG5.js";
46
- import {
47
- Quaternion_default
48
- } from "./chunk-ADX3CBKD.js";
49
- import {
50
- Cartesian4_default,
51
- Matrix4_default
52
- } from "./chunk-WN3F4CVG.js";
53
- import {
54
- ComponentDatatype_default
55
- } from "./chunk-VAL7DYNR.js";
56
- import {
57
- Cartesian3_default,
58
- Frozen_default,
59
- Matrix3_default
60
- } from "./chunk-ZQLZG4IN.js";
61
- import {
62
- Math_default
63
- } from "./chunk-5YPQBFRD.js";
64
- import {
65
- Check_default,
66
- DeveloperError_default
67
- } from "./chunk-6YR6JBMY.js";
68
- import {
69
- defined_default
70
- } from "./chunk-AHWAZRBV.js";
71
-
72
- // packages/engine/Source/Core/CullingVolume.js
73
- function CullingVolume(planes) {
74
- this.planes = planes ?? [];
75
- }
76
- var faces = [new Cartesian3_default(), new Cartesian3_default(), new Cartesian3_default()];
77
- Cartesian3_default.clone(Cartesian3_default.UNIT_X, faces[0]);
78
- Cartesian3_default.clone(Cartesian3_default.UNIT_Y, faces[1]);
79
- Cartesian3_default.clone(Cartesian3_default.UNIT_Z, faces[2]);
80
- var scratchPlaneCenter = new Cartesian3_default();
81
- var scratchPlaneNormal = new Cartesian3_default();
82
- var scratchPlane = new Plane_default(new Cartesian3_default(1, 0, 0), 0);
83
- CullingVolume.fromBoundingSphere = function(boundingSphere, result) {
84
- if (!defined_default(boundingSphere)) {
85
- throw new DeveloperError_default("boundingSphere is required.");
86
- }
87
- if (!defined_default(result)) {
88
- result = new CullingVolume();
89
- }
90
- const length = faces.length;
91
- const planes = result.planes;
92
- planes.length = 2 * length;
93
- const center = boundingSphere.center;
94
- const radius = boundingSphere.radius;
95
- let planeIndex = 0;
96
- for (let i = 0; i < length; ++i) {
97
- const faceNormal = faces[i];
98
- let plane0 = planes[planeIndex];
99
- let plane1 = planes[planeIndex + 1];
100
- if (!defined_default(plane0)) {
101
- plane0 = planes[planeIndex] = new Cartesian4_default();
102
- }
103
- if (!defined_default(plane1)) {
104
- plane1 = planes[planeIndex + 1] = new Cartesian4_default();
105
- }
106
- Cartesian3_default.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);
107
- Cartesian3_default.add(center, scratchPlaneCenter, scratchPlaneCenter);
108
- plane0.x = faceNormal.x;
109
- plane0.y = faceNormal.y;
110
- plane0.z = faceNormal.z;
111
- plane0.w = -Cartesian3_default.dot(faceNormal, scratchPlaneCenter);
112
- Cartesian3_default.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);
113
- Cartesian3_default.add(center, scratchPlaneCenter, scratchPlaneCenter);
114
- plane1.x = -faceNormal.x;
115
- plane1.y = -faceNormal.y;
116
- plane1.z = -faceNormal.z;
117
- plane1.w = -Cartesian3_default.dot(
118
- Cartesian3_default.negate(faceNormal, scratchPlaneNormal),
119
- scratchPlaneCenter
120
- );
121
- planeIndex += 2;
122
- }
123
- return result;
124
- };
125
- CullingVolume.prototype.computeVisibility = function(boundingVolume) {
126
- if (!defined_default(boundingVolume)) {
127
- throw new DeveloperError_default("boundingVolume is required.");
128
- }
129
- const planes = this.planes;
130
- let intersecting = false;
131
- for (let k = 0, len = planes.length; k < len; ++k) {
132
- const result = boundingVolume.intersectPlane(
133
- Plane_default.fromCartesian4(planes[k], scratchPlane)
134
- );
135
- if (result === Intersect_default.OUTSIDE) {
136
- return Intersect_default.OUTSIDE;
137
- } else if (result === Intersect_default.INTERSECTING) {
138
- intersecting = true;
139
- }
140
- }
141
- return intersecting ? Intersect_default.INTERSECTING : Intersect_default.INSIDE;
142
- };
143
- CullingVolume.prototype.computeVisibilityWithPlaneMask = function(boundingVolume, parentPlaneMask) {
144
- if (!defined_default(boundingVolume)) {
145
- throw new DeveloperError_default("boundingVolume is required.");
146
- }
147
- if (!defined_default(parentPlaneMask)) {
148
- throw new DeveloperError_default("parentPlaneMask is required.");
149
- }
150
- if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
151
- return parentPlaneMask;
152
- }
153
- let mask = CullingVolume.MASK_INSIDE;
154
- const planes = this.planes;
155
- for (let k = 0, len = planes.length; k < len; ++k) {
156
- const flag = k < 31 ? 1 << k : 0;
157
- if (k < 31 && (parentPlaneMask & flag) === 0) {
158
- continue;
159
- }
160
- const result = boundingVolume.intersectPlane(
161
- Plane_default.fromCartesian4(planes[k], scratchPlane)
162
- );
163
- if (result === Intersect_default.OUTSIDE) {
164
- return CullingVolume.MASK_OUTSIDE;
165
- } else if (result === Intersect_default.INTERSECTING) {
166
- mask |= flag;
167
- }
168
- }
169
- return mask;
170
- };
171
- CullingVolume.MASK_OUTSIDE = 4294967295;
172
- CullingVolume.MASK_INSIDE = 0;
173
- CullingVolume.MASK_INDETERMINATE = 2147483647;
174
- var CullingVolume_default = CullingVolume;
175
-
176
- // packages/engine/Source/Core/OrthographicOffCenterFrustum.js
177
- function OrthographicOffCenterFrustum(options) {
178
- options = options ?? Frozen_default.EMPTY_OBJECT;
179
- this.left = options.left;
180
- this._left = void 0;
181
- this.right = options.right;
182
- this._right = void 0;
183
- this.top = options.top;
184
- this._top = void 0;
185
- this.bottom = options.bottom;
186
- this._bottom = void 0;
187
- this.near = options.near ?? 1;
188
- this._near = this.near;
189
- this.far = options.far ?? 5e8;
190
- this._far = this.far;
191
- this._cullingVolume = new CullingVolume_default();
192
- this._orthographicMatrix = new Matrix4_default();
193
- }
194
- function update(frustum) {
195
- if (!defined_default(frustum.right) || !defined_default(frustum.left) || !defined_default(frustum.top) || !defined_default(frustum.bottom) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
196
- throw new DeveloperError_default(
197
- "right, left, top, bottom, near, or far parameters are not set."
198
- );
199
- }
200
- if (frustum.top !== frustum._top || frustum.bottom !== frustum._bottom || frustum.left !== frustum._left || frustum.right !== frustum._right || frustum.near !== frustum._near || frustum.far !== frustum._far) {
201
- if (frustum.left > frustum.right) {
202
- throw new DeveloperError_default("right must be greater than left.");
203
- }
204
- if (frustum.bottom > frustum.top) {
205
- throw new DeveloperError_default("top must be greater than bottom.");
206
- }
207
- if (frustum.near <= 0 || frustum.near > frustum.far) {
208
- throw new DeveloperError_default(
209
- "near must be greater than zero and less than far."
210
- );
211
- }
212
- frustum._left = frustum.left;
213
- frustum._right = frustum.right;
214
- frustum._top = frustum.top;
215
- frustum._bottom = frustum.bottom;
216
- frustum._near = frustum.near;
217
- frustum._far = frustum.far;
218
- frustum._orthographicMatrix = Matrix4_default.computeOrthographicOffCenter(
219
- frustum.left,
220
- frustum.right,
221
- frustum.bottom,
222
- frustum.top,
223
- frustum.near,
224
- frustum.far,
225
- frustum._orthographicMatrix
226
- );
227
- }
228
- }
229
- Object.defineProperties(OrthographicOffCenterFrustum.prototype, {
230
- /**
231
- * Gets the orthographic projection matrix computed from the view frustum.
232
- * @memberof OrthographicOffCenterFrustum.prototype
233
- * @type {Matrix4}
234
- * @readonly
235
- */
236
- projectionMatrix: {
237
- get: function() {
238
- update(this);
239
- return this._orthographicMatrix;
240
- }
241
- }
242
- });
243
- var getPlanesRight = new Cartesian3_default();
244
- var getPlanesNearCenter = new Cartesian3_default();
245
- var getPlanesPoint = new Cartesian3_default();
246
- var negateScratch = new Cartesian3_default();
247
- OrthographicOffCenterFrustum.prototype.computeCullingVolume = function(position, direction, up) {
248
- if (!defined_default(position)) {
249
- throw new DeveloperError_default("position is required.");
250
- }
251
- if (!defined_default(direction)) {
252
- throw new DeveloperError_default("direction is required.");
253
- }
254
- if (!defined_default(up)) {
255
- throw new DeveloperError_default("up is required.");
256
- }
257
- const planes = this._cullingVolume.planes;
258
- const t = this.top;
259
- const b = this.bottom;
260
- const r = this.right;
261
- const l = this.left;
262
- const n = this.near;
263
- const f = this.far;
264
- const right = Cartesian3_default.cross(direction, up, getPlanesRight);
265
- Cartesian3_default.normalize(right, right);
266
- const nearCenter = getPlanesNearCenter;
267
- Cartesian3_default.multiplyByScalar(direction, n, nearCenter);
268
- Cartesian3_default.add(position, nearCenter, nearCenter);
269
- const point = getPlanesPoint;
270
- Cartesian3_default.multiplyByScalar(right, l, point);
271
- Cartesian3_default.add(nearCenter, point, point);
272
- let plane = planes[0];
273
- if (!defined_default(plane)) {
274
- plane = planes[0] = new Cartesian4_default();
275
- }
276
- plane.x = right.x;
277
- plane.y = right.y;
278
- plane.z = right.z;
279
- plane.w = -Cartesian3_default.dot(right, point);
280
- Cartesian3_default.multiplyByScalar(right, r, point);
281
- Cartesian3_default.add(nearCenter, point, point);
282
- plane = planes[1];
283
- if (!defined_default(plane)) {
284
- plane = planes[1] = new Cartesian4_default();
285
- }
286
- plane.x = -right.x;
287
- plane.y = -right.y;
288
- plane.z = -right.z;
289
- plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(right, negateScratch), point);
290
- Cartesian3_default.multiplyByScalar(up, b, point);
291
- Cartesian3_default.add(nearCenter, point, point);
292
- plane = planes[2];
293
- if (!defined_default(plane)) {
294
- plane = planes[2] = new Cartesian4_default();
295
- }
296
- plane.x = up.x;
297
- plane.y = up.y;
298
- plane.z = up.z;
299
- plane.w = -Cartesian3_default.dot(up, point);
300
- Cartesian3_default.multiplyByScalar(up, t, point);
301
- Cartesian3_default.add(nearCenter, point, point);
302
- plane = planes[3];
303
- if (!defined_default(plane)) {
304
- plane = planes[3] = new Cartesian4_default();
305
- }
306
- plane.x = -up.x;
307
- plane.y = -up.y;
308
- plane.z = -up.z;
309
- plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(up, negateScratch), point);
310
- plane = planes[4];
311
- if (!defined_default(plane)) {
312
- plane = planes[4] = new Cartesian4_default();
313
- }
314
- plane.x = direction.x;
315
- plane.y = direction.y;
316
- plane.z = direction.z;
317
- plane.w = -Cartesian3_default.dot(direction, nearCenter);
318
- Cartesian3_default.multiplyByScalar(direction, f, point);
319
- Cartesian3_default.add(position, point, point);
320
- plane = planes[5];
321
- if (!defined_default(plane)) {
322
- plane = planes[5] = new Cartesian4_default();
323
- }
324
- plane.x = -direction.x;
325
- plane.y = -direction.y;
326
- plane.z = -direction.z;
327
- plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(direction, negateScratch), point);
328
- return this._cullingVolume;
329
- };
330
- OrthographicOffCenterFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result) {
331
- update(this);
332
- if (!defined_default(drawingBufferWidth) || !defined_default(drawingBufferHeight)) {
333
- throw new DeveloperError_default(
334
- "Both drawingBufferWidth and drawingBufferHeight are required."
335
- );
336
- }
337
- if (drawingBufferWidth <= 0) {
338
- throw new DeveloperError_default("drawingBufferWidth must be greater than zero.");
339
- }
340
- if (drawingBufferHeight <= 0) {
341
- throw new DeveloperError_default("drawingBufferHeight must be greater than zero.");
342
- }
343
- if (!defined_default(distance)) {
344
- throw new DeveloperError_default("distance is required.");
345
- }
346
- if (!defined_default(pixelRatio)) {
347
- throw new DeveloperError_default("pixelRatio is required.");
348
- }
349
- if (pixelRatio <= 0) {
350
- throw new DeveloperError_default("pixelRatio must be greater than zero.");
351
- }
352
- if (!defined_default(result)) {
353
- throw new DeveloperError_default("A result object is required.");
354
- }
355
- const frustumWidth = this.right - this.left;
356
- const frustumHeight = this.top - this.bottom;
357
- const pixelWidth = pixelRatio * frustumWidth / drawingBufferWidth;
358
- const pixelHeight = pixelRatio * frustumHeight / drawingBufferHeight;
359
- result.x = pixelWidth;
360
- result.y = pixelHeight;
361
- return result;
362
- };
363
- OrthographicOffCenterFrustum.prototype.clone = function(result) {
364
- if (!defined_default(result)) {
365
- result = new OrthographicOffCenterFrustum();
366
- }
367
- result.left = this.left;
368
- result.right = this.right;
369
- result.top = this.top;
370
- result.bottom = this.bottom;
371
- result.near = this.near;
372
- result.far = this.far;
373
- result._left = void 0;
374
- result._right = void 0;
375
- result._top = void 0;
376
- result._bottom = void 0;
377
- result._near = void 0;
378
- result._far = void 0;
379
- return result;
380
- };
381
- OrthographicOffCenterFrustum.prototype.equals = function(other) {
382
- return defined_default(other) && other instanceof OrthographicOffCenterFrustum && this.right === other.right && this.left === other.left && this.top === other.top && this.bottom === other.bottom && this.near === other.near && this.far === other.far;
383
- };
384
- OrthographicOffCenterFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
385
- return other === this || defined_default(other) && other instanceof OrthographicOffCenterFrustum && Math_default.equalsEpsilon(
386
- this.right,
387
- other.right,
388
- relativeEpsilon,
389
- absoluteEpsilon
390
- ) && Math_default.equalsEpsilon(
391
- this.left,
392
- other.left,
393
- relativeEpsilon,
394
- absoluteEpsilon
395
- ) && Math_default.equalsEpsilon(
396
- this.top,
397
- other.top,
398
- relativeEpsilon,
399
- absoluteEpsilon
400
- ) && Math_default.equalsEpsilon(
401
- this.bottom,
402
- other.bottom,
403
- relativeEpsilon,
404
- absoluteEpsilon
405
- ) && Math_default.equalsEpsilon(
406
- this.near,
407
- other.near,
408
- relativeEpsilon,
409
- absoluteEpsilon
410
- ) && Math_default.equalsEpsilon(
411
- this.far,
412
- other.far,
413
- relativeEpsilon,
414
- absoluteEpsilon
415
- );
416
- };
417
- var OrthographicOffCenterFrustum_default = OrthographicOffCenterFrustum;
418
-
419
- // packages/engine/Source/Core/OrthographicFrustum.js
420
- function OrthographicFrustum(options) {
421
- options = options ?? Frozen_default.EMPTY_OBJECT;
422
- this._offCenterFrustum = new OrthographicOffCenterFrustum_default();
423
- this.width = options.width;
424
- this._width = void 0;
425
- this.aspectRatio = options.aspectRatio;
426
- this._aspectRatio = void 0;
427
- this.near = options.near ?? 1;
428
- this._near = this.near;
429
- this.far = options.far ?? 5e8;
430
- this._far = this.far;
431
- }
432
- OrthographicFrustum.packedLength = 4;
433
- OrthographicFrustum.pack = function(value, array, startingIndex) {
434
- Check_default.typeOf.object("value", value);
435
- Check_default.defined("array", array);
436
- startingIndex = startingIndex ?? 0;
437
- array[startingIndex++] = value.width;
438
- array[startingIndex++] = value.aspectRatio;
439
- array[startingIndex++] = value.near;
440
- array[startingIndex] = value.far;
441
- return array;
442
- };
443
- OrthographicFrustum.unpack = function(array, startingIndex, result) {
444
- Check_default.defined("array", array);
445
- startingIndex = startingIndex ?? 0;
446
- if (!defined_default(result)) {
447
- result = new OrthographicFrustum();
448
- }
449
- result.width = array[startingIndex++];
450
- result.aspectRatio = array[startingIndex++];
451
- result.near = array[startingIndex++];
452
- result.far = array[startingIndex];
453
- return result;
454
- };
455
- function update2(frustum) {
456
- if (!defined_default(frustum.width) || !defined_default(frustum.aspectRatio) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
457
- throw new DeveloperError_default(
458
- "width, aspectRatio, near, or far parameters are not set."
459
- );
460
- }
461
- const f = frustum._offCenterFrustum;
462
- if (frustum.width !== frustum._width || frustum.aspectRatio !== frustum._aspectRatio || frustum.near !== frustum._near || frustum.far !== frustum._far) {
463
- if (frustum.aspectRatio < 0) {
464
- throw new DeveloperError_default("aspectRatio must be positive.");
465
- }
466
- if (frustum.near < 0 || frustum.near > frustum.far) {
467
- throw new DeveloperError_default(
468
- "near must be greater than zero and less than far."
469
- );
470
- }
471
- frustum._aspectRatio = frustum.aspectRatio;
472
- frustum._width = frustum.width;
473
- frustum._near = frustum.near;
474
- frustum._far = frustum.far;
475
- const ratio = 1 / frustum.aspectRatio;
476
- f.right = frustum.width * 0.5;
477
- f.left = -f.right;
478
- f.top = ratio * f.right;
479
- f.bottom = -f.top;
480
- f.near = frustum.near;
481
- f.far = frustum.far;
482
- }
483
- }
484
- Object.defineProperties(OrthographicFrustum.prototype, {
485
- /**
486
- * Gets the orthographic projection matrix computed from the view frustum.
487
- * @memberof OrthographicFrustum.prototype
488
- * @type {Matrix4}
489
- * @readonly
490
- */
491
- projectionMatrix: {
492
- get: function() {
493
- update2(this);
494
- return this._offCenterFrustum.projectionMatrix;
495
- }
496
- },
497
- /**
498
- * Gets the underlying {@link OrthographicOffCenterFrustum}
499
- * @memberof OrthographicFrustum.prototype
500
- * @type {OrthographicOffCenterFrustum}
501
- * @readonly
502
- * @private
503
- */
504
- offCenterFrustum: {
505
- get: function() {
506
- update2(this);
507
- return this._offCenterFrustum;
508
- }
509
- }
510
- });
511
- OrthographicFrustum.prototype.computeCullingVolume = function(position, direction, up) {
512
- update2(this);
513
- return this._offCenterFrustum.computeCullingVolume(position, direction, up);
514
- };
515
- OrthographicFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result) {
516
- update2(this);
517
- return this._offCenterFrustum.getPixelDimensions(
518
- drawingBufferWidth,
519
- drawingBufferHeight,
520
- distance,
521
- pixelRatio,
522
- result
523
- );
524
- };
525
- OrthographicFrustum.prototype.clone = function(result) {
526
- if (!defined_default(result)) {
527
- result = new OrthographicFrustum();
528
- }
529
- result.aspectRatio = this.aspectRatio;
530
- result.width = this.width;
531
- result.near = this.near;
532
- result.far = this.far;
533
- result._aspectRatio = void 0;
534
- result._width = void 0;
535
- result._near = void 0;
536
- result._far = void 0;
537
- this._offCenterFrustum.clone(result._offCenterFrustum);
538
- return result;
539
- };
540
- OrthographicFrustum.prototype.equals = function(other) {
541
- if (!defined_default(other) || !(other instanceof OrthographicFrustum)) {
542
- return false;
543
- }
544
- update2(this);
545
- update2(other);
546
- return this.width === other.width && this.aspectRatio === other.aspectRatio && this._offCenterFrustum.equals(other._offCenterFrustum);
547
- };
548
- OrthographicFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
549
- if (!defined_default(other) || !(other instanceof OrthographicFrustum)) {
550
- return false;
551
- }
552
- update2(this);
553
- update2(other);
554
- return Math_default.equalsEpsilon(
555
- this.width,
556
- other.width,
557
- relativeEpsilon,
558
- absoluteEpsilon
559
- ) && Math_default.equalsEpsilon(
560
- this.aspectRatio,
561
- other.aspectRatio,
562
- relativeEpsilon,
563
- absoluteEpsilon
564
- ) && this._offCenterFrustum.equalsEpsilon(
565
- other._offCenterFrustum,
566
- relativeEpsilon,
567
- absoluteEpsilon
568
- );
569
- };
570
- var OrthographicFrustum_default = OrthographicFrustum;
571
-
572
- // packages/engine/Source/Core/PerspectiveOffCenterFrustum.js
573
- function PerspectiveOffCenterFrustum(options) {
574
- options = options ?? Frozen_default.EMPTY_OBJECT;
575
- this.left = options.left;
576
- this._left = void 0;
577
- this.right = options.right;
578
- this._right = void 0;
579
- this.top = options.top;
580
- this._top = void 0;
581
- this.bottom = options.bottom;
582
- this._bottom = void 0;
583
- this.near = options.near ?? 1;
584
- this._near = this.near;
585
- this.far = options.far ?? 5e8;
586
- this._far = this.far;
587
- this._cullingVolume = new CullingVolume_default();
588
- this._perspectiveMatrix = new Matrix4_default();
589
- this._infinitePerspective = new Matrix4_default();
590
- }
591
- function update3(frustum) {
592
- if (!defined_default(frustum.right) || !defined_default(frustum.left) || !defined_default(frustum.top) || !defined_default(frustum.bottom) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
593
- throw new DeveloperError_default(
594
- "right, left, top, bottom, near, or far parameters are not set."
595
- );
596
- }
597
- const { top, bottom, right, left, near, far } = frustum;
598
- const changed = top !== frustum._top || bottom !== frustum._bottom || left !== frustum._left || right !== frustum._right || near !== frustum._near || far !== frustum._far;
599
- if (!changed) {
600
- return;
601
- }
602
- if (frustum.near <= 0 || frustum.near > frustum.far) {
603
- throw new DeveloperError_default(
604
- "near must be greater than zero and less than far."
605
- );
606
- }
607
- frustum._left = left;
608
- frustum._right = right;
609
- frustum._top = top;
610
- frustum._bottom = bottom;
611
- frustum._near = near;
612
- frustum._far = far;
613
- frustum._perspectiveMatrix = Matrix4_default.computePerspectiveOffCenter(
614
- left,
615
- right,
616
- bottom,
617
- top,
618
- near,
619
- far,
620
- frustum._perspectiveMatrix
621
- );
622
- frustum._infinitePerspective = Matrix4_default.computeInfinitePerspectiveOffCenter(
623
- left,
624
- right,
625
- bottom,
626
- top,
627
- near,
628
- frustum._infinitePerspective
629
- );
630
- }
631
- Object.defineProperties(PerspectiveOffCenterFrustum.prototype, {
632
- /**
633
- * Gets the perspective projection matrix computed from the view frustum.
634
- * The projection matrix will be recomputed if any frustum parameters have changed.
635
- *
636
- * @memberof PerspectiveOffCenterFrustum.prototype
637
- * @type {Matrix4}
638
- * @readonly
639
- *
640
- * @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix
641
- */
642
- projectionMatrix: {
643
- get: function() {
644
- update3(this);
645
- return this._perspectiveMatrix;
646
- }
647
- },
648
- /**
649
- * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
650
- * @memberof PerspectiveOffCenterFrustum.prototype
651
- * @type {Matrix4}
652
- * @readonly
653
- *
654
- * @see PerspectiveOffCenterFrustum#projectionMatrix
655
- */
656
- infiniteProjectionMatrix: {
657
- get: function() {
658
- update3(this);
659
- return this._infinitePerspective;
660
- }
661
- }
662
- });
663
- var getPlanesRight2 = new Cartesian3_default();
664
- var getPlanesNearCenter2 = new Cartesian3_default();
665
- var getPlanesFarCenter = new Cartesian3_default();
666
- var getPlanesNormal = new Cartesian3_default();
667
- PerspectiveOffCenterFrustum.prototype.computeCullingVolume = function(position, direction, up) {
668
- if (!defined_default(position)) {
669
- throw new DeveloperError_default("position is required.");
670
- }
671
- if (!defined_default(direction)) {
672
- throw new DeveloperError_default("direction is required.");
673
- }
674
- if (!defined_default(up)) {
675
- throw new DeveloperError_default("up is required.");
676
- }
677
- const planes = this._cullingVolume.planes;
678
- const t = this.top;
679
- const b = this.bottom;
680
- const r = this.right;
681
- const l = this.left;
682
- const n = this.near;
683
- const f = this.far;
684
- const right = Cartesian3_default.cross(direction, up, getPlanesRight2);
685
- const nearCenter = getPlanesNearCenter2;
686
- Cartesian3_default.multiplyByScalar(direction, n, nearCenter);
687
- Cartesian3_default.add(position, nearCenter, nearCenter);
688
- const farCenter = getPlanesFarCenter;
689
- Cartesian3_default.multiplyByScalar(direction, f, farCenter);
690
- Cartesian3_default.add(position, farCenter, farCenter);
691
- const normal = getPlanesNormal;
692
- Cartesian3_default.multiplyByScalar(right, l, normal);
693
- Cartesian3_default.add(nearCenter, normal, normal);
694
- Cartesian3_default.subtract(normal, position, normal);
695
- Cartesian3_default.normalize(normal, normal);
696
- Cartesian3_default.cross(normal, up, normal);
697
- Cartesian3_default.normalize(normal, normal);
698
- let plane = planes[0];
699
- if (!defined_default(plane)) {
700
- plane = planes[0] = new Cartesian4_default();
701
- }
702
- plane.x = normal.x;
703
- plane.y = normal.y;
704
- plane.z = normal.z;
705
- plane.w = -Cartesian3_default.dot(normal, position);
706
- Cartesian3_default.multiplyByScalar(right, r, normal);
707
- Cartesian3_default.add(nearCenter, normal, normal);
708
- Cartesian3_default.subtract(normal, position, normal);
709
- Cartesian3_default.cross(up, normal, normal);
710
- Cartesian3_default.normalize(normal, normal);
711
- plane = planes[1];
712
- if (!defined_default(plane)) {
713
- plane = planes[1] = new Cartesian4_default();
714
- }
715
- plane.x = normal.x;
716
- plane.y = normal.y;
717
- plane.z = normal.z;
718
- plane.w = -Cartesian3_default.dot(normal, position);
719
- Cartesian3_default.multiplyByScalar(up, b, normal);
720
- Cartesian3_default.add(nearCenter, normal, normal);
721
- Cartesian3_default.subtract(normal, position, normal);
722
- Cartesian3_default.cross(right, normal, normal);
723
- Cartesian3_default.normalize(normal, normal);
724
- plane = planes[2];
725
- if (!defined_default(plane)) {
726
- plane = planes[2] = new Cartesian4_default();
727
- }
728
- plane.x = normal.x;
729
- plane.y = normal.y;
730
- plane.z = normal.z;
731
- plane.w = -Cartesian3_default.dot(normal, position);
732
- Cartesian3_default.multiplyByScalar(up, t, normal);
733
- Cartesian3_default.add(nearCenter, normal, normal);
734
- Cartesian3_default.subtract(normal, position, normal);
735
- Cartesian3_default.cross(normal, right, normal);
736
- Cartesian3_default.normalize(normal, normal);
737
- plane = planes[3];
738
- if (!defined_default(plane)) {
739
- plane = planes[3] = new Cartesian4_default();
740
- }
741
- plane.x = normal.x;
742
- plane.y = normal.y;
743
- plane.z = normal.z;
744
- plane.w = -Cartesian3_default.dot(normal, position);
745
- plane = planes[4];
746
- if (!defined_default(plane)) {
747
- plane = planes[4] = new Cartesian4_default();
748
- }
749
- plane.x = direction.x;
750
- plane.y = direction.y;
751
- plane.z = direction.z;
752
- plane.w = -Cartesian3_default.dot(direction, nearCenter);
753
- Cartesian3_default.negate(direction, normal);
754
- plane = planes[5];
755
- if (!defined_default(plane)) {
756
- plane = planes[5] = new Cartesian4_default();
757
- }
758
- plane.x = normal.x;
759
- plane.y = normal.y;
760
- plane.z = normal.z;
761
- plane.w = -Cartesian3_default.dot(normal, farCenter);
762
- return this._cullingVolume;
763
- };
764
- PerspectiveOffCenterFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result) {
765
- update3(this);
766
- if (!defined_default(drawingBufferWidth) || !defined_default(drawingBufferHeight)) {
767
- throw new DeveloperError_default(
768
- "Both drawingBufferWidth and drawingBufferHeight are required."
769
- );
770
- }
771
- if (drawingBufferWidth <= 0) {
772
- throw new DeveloperError_default("drawingBufferWidth must be greater than zero.");
773
- }
774
- if (drawingBufferHeight <= 0) {
775
- throw new DeveloperError_default("drawingBufferHeight must be greater than zero.");
776
- }
777
- if (!defined_default(distance)) {
778
- throw new DeveloperError_default("distance is required.");
779
- }
780
- if (!defined_default(pixelRatio)) {
781
- throw new DeveloperError_default("pixelRatio is required");
782
- }
783
- if (pixelRatio <= 0) {
784
- throw new DeveloperError_default("pixelRatio must be greater than zero.");
785
- }
786
- if (!defined_default(result)) {
787
- throw new DeveloperError_default("A result object is required.");
788
- }
789
- const inverseNear = 1 / this.near;
790
- let tanTheta = this.top * inverseNear;
791
- const pixelHeight = 2 * pixelRatio * distance * tanTheta / drawingBufferHeight;
792
- tanTheta = this.right * inverseNear;
793
- const pixelWidth = 2 * pixelRatio * distance * tanTheta / drawingBufferWidth;
794
- result.x = pixelWidth;
795
- result.y = pixelHeight;
796
- return result;
797
- };
798
- PerspectiveOffCenterFrustum.prototype.clone = function(result) {
799
- if (!defined_default(result)) {
800
- result = new PerspectiveOffCenterFrustum();
801
- }
802
- result.right = this.right;
803
- result.left = this.left;
804
- result.top = this.top;
805
- result.bottom = this.bottom;
806
- result.near = this.near;
807
- result.far = this.far;
808
- result._left = void 0;
809
- result._right = void 0;
810
- result._top = void 0;
811
- result._bottom = void 0;
812
- result._near = void 0;
813
- result._far = void 0;
814
- return result;
815
- };
816
- PerspectiveOffCenterFrustum.prototype.equals = function(other) {
817
- return defined_default(other) && other instanceof PerspectiveOffCenterFrustum && this.right === other.right && this.left === other.left && this.top === other.top && this.bottom === other.bottom && this.near === other.near && this.far === other.far;
818
- };
819
- PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
820
- return other === this || defined_default(other) && other instanceof PerspectiveOffCenterFrustum && Math_default.equalsEpsilon(
821
- this.right,
822
- other.right,
823
- relativeEpsilon,
824
- absoluteEpsilon
825
- ) && Math_default.equalsEpsilon(
826
- this.left,
827
- other.left,
828
- relativeEpsilon,
829
- absoluteEpsilon
830
- ) && Math_default.equalsEpsilon(
831
- this.top,
832
- other.top,
833
- relativeEpsilon,
834
- absoluteEpsilon
835
- ) && Math_default.equalsEpsilon(
836
- this.bottom,
837
- other.bottom,
838
- relativeEpsilon,
839
- absoluteEpsilon
840
- ) && Math_default.equalsEpsilon(
841
- this.near,
842
- other.near,
843
- relativeEpsilon,
844
- absoluteEpsilon
845
- ) && Math_default.equalsEpsilon(
846
- this.far,
847
- other.far,
848
- relativeEpsilon,
849
- absoluteEpsilon
850
- );
851
- };
852
- var PerspectiveOffCenterFrustum_default = PerspectiveOffCenterFrustum;
853
-
854
- // packages/engine/Source/Core/PerspectiveFrustum.js
855
- function PerspectiveFrustum(options) {
856
- options = options ?? Frozen_default.EMPTY_OBJECT;
857
- this._offCenterFrustum = new PerspectiveOffCenterFrustum_default();
858
- this.fov = options.fov;
859
- this._fov = void 0;
860
- this._fovy = void 0;
861
- this._sseDenominator = void 0;
862
- this.aspectRatio = options.aspectRatio;
863
- this._aspectRatio = void 0;
864
- this.near = options.near ?? 1;
865
- this._near = this.near;
866
- this.far = options.far ?? 5e8;
867
- this._far = this.far;
868
- this.xOffset = options.xOffset ?? 0;
869
- this._xOffset = this.xOffset;
870
- this.yOffset = options.yOffset ?? 0;
871
- this._yOffset = this.yOffset;
872
- }
873
- PerspectiveFrustum.packedLength = 6;
874
- PerspectiveFrustum.pack = function(value, array, startingIndex) {
875
- Check_default.typeOf.object("value", value);
876
- Check_default.defined("array", array);
877
- startingIndex = startingIndex ?? 0;
878
- array[startingIndex++] = value.fov;
879
- array[startingIndex++] = value.aspectRatio;
880
- array[startingIndex++] = value.near;
881
- array[startingIndex++] = value.far;
882
- array[startingIndex++] = value.xOffset;
883
- array[startingIndex] = value.yOffset;
884
- return array;
885
- };
886
- PerspectiveFrustum.unpack = function(array, startingIndex, result) {
887
- Check_default.defined("array", array);
888
- startingIndex = startingIndex ?? 0;
889
- if (!defined_default(result)) {
890
- result = new PerspectiveFrustum();
891
- }
892
- result.fov = array[startingIndex++];
893
- result.aspectRatio = array[startingIndex++];
894
- result.near = array[startingIndex++];
895
- result.far = array[startingIndex++];
896
- result.xOffset = array[startingIndex++];
897
- result.yOffset = array[startingIndex];
898
- return result;
899
- };
900
- function update4(frustum) {
901
- if (!defined_default(frustum.fov) || !defined_default(frustum.aspectRatio) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
902
- throw new DeveloperError_default(
903
- "fov, aspectRatio, near, or far parameters are not set."
904
- );
905
- }
906
- const changed = frustum.fov !== frustum._fov || frustum.aspectRatio !== frustum._aspectRatio || frustum.near !== frustum._near || frustum.far !== frustum._far || frustum.xOffset !== frustum._xOffset || frustum.yOffset !== frustum._yOffset;
907
- if (!changed) {
908
- return;
909
- }
910
- Check_default.typeOf.number.greaterThanOrEquals("fov", frustum.fov, 0);
911
- Check_default.typeOf.number.lessThan("fov", frustum.fov, Math.PI);
912
- Check_default.typeOf.number.greaterThanOrEquals(
913
- "aspectRatio",
914
- frustum.aspectRatio,
915
- 0
916
- );
917
- Check_default.typeOf.number.greaterThanOrEquals("near", frustum.near, 0);
918
- if (frustum.near > frustum.far) {
919
- throw new DeveloperError_default("near must be less than far.");
920
- }
921
- frustum._aspectRatio = frustum.aspectRatio;
922
- frustum._fov = frustum.fov;
923
- frustum._fovy = frustum.aspectRatio <= 1 ? frustum.fov : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2;
924
- frustum._near = frustum.near;
925
- frustum._far = frustum.far;
926
- frustum._sseDenominator = 2 * Math.tan(0.5 * frustum._fovy);
927
- frustum._xOffset = frustum.xOffset;
928
- frustum._yOffset = frustum.yOffset;
929
- const f = frustum._offCenterFrustum;
930
- f.top = frustum.near * Math.tan(0.5 * frustum._fovy);
931
- f.bottom = -f.top;
932
- f.right = frustum.aspectRatio * f.top;
933
- f.left = -f.right;
934
- f.near = frustum.near;
935
- f.far = frustum.far;
936
- f.right += frustum.xOffset;
937
- f.left += frustum.xOffset;
938
- f.top += frustum.yOffset;
939
- f.bottom += frustum.yOffset;
940
- }
941
- Object.defineProperties(PerspectiveFrustum.prototype, {
942
- /**
943
- * Gets the perspective projection matrix computed from the view frustum.
944
- * If necessary, the projection matrix will be recomputed.
945
- *
946
- * @memberof PerspectiveFrustum.prototype
947
- * @type {Matrix4}
948
- * @readonly
949
- *
950
- * @see PerspectiveOffCenterFrustum#projectionMatrix.
951
- * @see PerspectiveFrustum#infiniteProjectionMatrix
952
- */
953
- projectionMatrix: {
954
- get: function() {
955
- update4(this);
956
- return this._offCenterFrustum.projectionMatrix;
957
- }
958
- },
959
- /**
960
- * The perspective projection matrix computed from the view frustum with an infinite far plane.
961
- * @memberof PerspectiveFrustum.prototype
962
- * @type {Matrix4}
963
- * @readonly
964
- *
965
- * @see PerspectiveFrustum#projectionMatrix
966
- */
967
- infiniteProjectionMatrix: {
968
- get: function() {
969
- update4(this);
970
- return this._offCenterFrustum.infiniteProjectionMatrix;
971
- }
972
- },
973
- /**
974
- * Gets the angle of the vertical field of view, in radians.
975
- * @memberof PerspectiveFrustum.prototype
976
- * @type {number|undefined}
977
- * @readonly
978
- * @default undefined
979
- */
980
- fovy: {
981
- get: function() {
982
- update4(this);
983
- return this._fovy;
984
- }
985
- },
986
- /**
987
- * @readonly
988
- * @private
989
- */
990
- sseDenominator: {
991
- get: function() {
992
- update4(this);
993
- return this._sseDenominator;
994
- }
995
- },
996
- /**
997
- * Gets the underlying {@link PerspectiveOffCenterFrustum}.
998
- * @memberof PerspectiveFrustum.prototype
999
- * @type {PerspectiveOffCenterFrustum}
1000
- * @readonly
1001
- * @private
1002
- */
1003
- offCenterFrustum: {
1004
- get: function() {
1005
- update4(this);
1006
- return this._offCenterFrustum;
1007
- }
1008
- }
1009
- });
1010
- PerspectiveFrustum.prototype.computeCullingVolume = function(position, direction, up) {
1011
- update4(this);
1012
- return this._offCenterFrustum.computeCullingVolume(position, direction, up);
1013
- };
1014
- PerspectiveFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result) {
1015
- update4(this);
1016
- return this._offCenterFrustum.getPixelDimensions(
1017
- drawingBufferWidth,
1018
- drawingBufferHeight,
1019
- distance,
1020
- pixelRatio,
1021
- result
1022
- );
1023
- };
1024
- PerspectiveFrustum.prototype.clone = function(result) {
1025
- if (!defined_default(result)) {
1026
- result = new PerspectiveFrustum();
1027
- }
1028
- result.aspectRatio = this.aspectRatio;
1029
- result.fov = this.fov;
1030
- result.near = this.near;
1031
- result.far = this.far;
1032
- result._aspectRatio = void 0;
1033
- result._fov = void 0;
1034
- result._near = void 0;
1035
- result._far = void 0;
1036
- this._offCenterFrustum.clone(result._offCenterFrustum);
1037
- return result;
1038
- };
1039
- PerspectiveFrustum.prototype.equals = function(other) {
1040
- if (!defined_default(other) || !(other instanceof PerspectiveFrustum)) {
1041
- return false;
1042
- }
1043
- update4(this);
1044
- update4(other);
1045
- return this.fov === other.fov && this.aspectRatio === other.aspectRatio && this._offCenterFrustum.equals(other._offCenterFrustum);
1046
- };
1047
- PerspectiveFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
1048
- if (!defined_default(other) || !(other instanceof PerspectiveFrustum)) {
1049
- return false;
1050
- }
1051
- update4(this);
1052
- update4(other);
1053
- return Math_default.equalsEpsilon(
1054
- this.fov,
1055
- other.fov,
1056
- relativeEpsilon,
1057
- absoluteEpsilon
1058
- ) && Math_default.equalsEpsilon(
1059
- this.aspectRatio,
1060
- other.aspectRatio,
1061
- relativeEpsilon,
1062
- absoluteEpsilon
1063
- ) && this._offCenterFrustum.equalsEpsilon(
1064
- other._offCenterFrustum,
1065
- relativeEpsilon,
1066
- absoluteEpsilon
1067
- );
1068
- };
1069
- var PerspectiveFrustum_default = PerspectiveFrustum;
1070
-
1071
- // packages/engine/Source/Core/FrustumGeometry.js
1072
- var PERSPECTIVE = 0;
1073
- var ORTHOGRAPHIC = 1;
1074
- function FrustumGeometry(options) {
1075
- Check_default.typeOf.object("options", options);
1076
- Check_default.typeOf.object("options.frustum", options.frustum);
1077
- Check_default.typeOf.object("options.origin", options.origin);
1078
- Check_default.typeOf.object("options.orientation", options.orientation);
1079
- const frustum = options.frustum;
1080
- const orientation = options.orientation;
1081
- const origin = options.origin;
1082
- const vertexFormat = options.vertexFormat ?? VertexFormat_default.DEFAULT;
1083
- const drawNearPlane = options._drawNearPlane ?? true;
1084
- let frustumType;
1085
- let frustumPackedLength;
1086
- if (frustum instanceof PerspectiveFrustum_default) {
1087
- frustumType = PERSPECTIVE;
1088
- frustumPackedLength = PerspectiveFrustum_default.packedLength;
1089
- } else if (frustum instanceof OrthographicFrustum_default) {
1090
- frustumType = ORTHOGRAPHIC;
1091
- frustumPackedLength = OrthographicFrustum_default.packedLength;
1092
- }
1093
- this._frustumType = frustumType;
1094
- this._frustum = frustum.clone();
1095
- this._origin = Cartesian3_default.clone(origin);
1096
- this._orientation = Quaternion_default.clone(orientation);
1097
- this._drawNearPlane = drawNearPlane;
1098
- this._vertexFormat = vertexFormat;
1099
- this._workerName = "createFrustumGeometry";
1100
- this.packedLength = 2 + frustumPackedLength + Cartesian3_default.packedLength + Quaternion_default.packedLength + VertexFormat_default.packedLength;
1101
- }
1102
- FrustumGeometry.pack = function(value, array, startingIndex) {
1103
- Check_default.typeOf.object("value", value);
1104
- Check_default.defined("array", array);
1105
- startingIndex = startingIndex ?? 0;
1106
- const frustumType = value._frustumType;
1107
- const frustum = value._frustum;
1108
- array[startingIndex++] = frustumType;
1109
- if (frustumType === PERSPECTIVE) {
1110
- PerspectiveFrustum_default.pack(frustum, array, startingIndex);
1111
- startingIndex += PerspectiveFrustum_default.packedLength;
1112
- } else {
1113
- OrthographicFrustum_default.pack(frustum, array, startingIndex);
1114
- startingIndex += OrthographicFrustum_default.packedLength;
1115
- }
1116
- Cartesian3_default.pack(value._origin, array, startingIndex);
1117
- startingIndex += Cartesian3_default.packedLength;
1118
- Quaternion_default.pack(value._orientation, array, startingIndex);
1119
- startingIndex += Quaternion_default.packedLength;
1120
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
1121
- startingIndex += VertexFormat_default.packedLength;
1122
- array[startingIndex] = value._drawNearPlane ? 1 : 0;
1123
- return array;
1124
- };
1125
- var scratchPackPerspective = new PerspectiveFrustum_default();
1126
- var scratchPackOrthographic = new OrthographicFrustum_default();
1127
- var scratchPackQuaternion = new Quaternion_default();
1128
- var scratchPackorigin = new Cartesian3_default();
1129
- var scratchVertexFormat = new VertexFormat_default();
1130
- FrustumGeometry.unpack = function(array, startingIndex, result) {
1131
- Check_default.defined("array", array);
1132
- startingIndex = startingIndex ?? 0;
1133
- const frustumType = array[startingIndex++];
1134
- let frustum;
1135
- if (frustumType === PERSPECTIVE) {
1136
- frustum = PerspectiveFrustum_default.unpack(
1137
- array,
1138
- startingIndex,
1139
- scratchPackPerspective
1140
- );
1141
- startingIndex += PerspectiveFrustum_default.packedLength;
1142
- } else {
1143
- frustum = OrthographicFrustum_default.unpack(
1144
- array,
1145
- startingIndex,
1146
- scratchPackOrthographic
1147
- );
1148
- startingIndex += OrthographicFrustum_default.packedLength;
1149
- }
1150
- const origin = Cartesian3_default.unpack(array, startingIndex, scratchPackorigin);
1151
- startingIndex += Cartesian3_default.packedLength;
1152
- const orientation = Quaternion_default.unpack(
1153
- array,
1154
- startingIndex,
1155
- scratchPackQuaternion
1156
- );
1157
- startingIndex += Quaternion_default.packedLength;
1158
- const vertexFormat = VertexFormat_default.unpack(
1159
- array,
1160
- startingIndex,
1161
- scratchVertexFormat
1162
- );
1163
- startingIndex += VertexFormat_default.packedLength;
1164
- const drawNearPlane = array[startingIndex] === 1;
1165
- if (!defined_default(result)) {
1166
- return new FrustumGeometry({
1167
- frustum,
1168
- origin,
1169
- orientation,
1170
- vertexFormat,
1171
- _drawNearPlane: drawNearPlane
1172
- });
1173
- }
1174
- const frustumResult = frustumType === result._frustumType ? result._frustum : void 0;
1175
- result._frustum = frustum.clone(frustumResult);
1176
- result._frustumType = frustumType;
1177
- result._origin = Cartesian3_default.clone(origin, result._origin);
1178
- result._orientation = Quaternion_default.clone(orientation, result._orientation);
1179
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
1180
- result._drawNearPlane = drawNearPlane;
1181
- return result;
1182
- };
1183
- function getAttributes(offset, normals, tangents, bitangents, st, normal, tangent, bitangent) {
1184
- const stOffset = offset / 3 * 2;
1185
- for (let i = 0; i < 4; ++i) {
1186
- if (defined_default(normals)) {
1187
- normals[offset] = normal.x;
1188
- normals[offset + 1] = normal.y;
1189
- normals[offset + 2] = normal.z;
1190
- }
1191
- if (defined_default(tangents)) {
1192
- tangents[offset] = tangent.x;
1193
- tangents[offset + 1] = tangent.y;
1194
- tangents[offset + 2] = tangent.z;
1195
- }
1196
- if (defined_default(bitangents)) {
1197
- bitangents[offset] = bitangent.x;
1198
- bitangents[offset + 1] = bitangent.y;
1199
- bitangents[offset + 2] = bitangent.z;
1200
- }
1201
- offset += 3;
1202
- }
1203
- st[stOffset] = 0;
1204
- st[stOffset + 1] = 0;
1205
- st[stOffset + 2] = 1;
1206
- st[stOffset + 3] = 0;
1207
- st[stOffset + 4] = 1;
1208
- st[stOffset + 5] = 1;
1209
- st[stOffset + 6] = 0;
1210
- st[stOffset + 7] = 1;
1211
- }
1212
- var scratchRotationMatrix = new Matrix3_default();
1213
- var scratchViewMatrix = new Matrix4_default();
1214
- var scratchInverseMatrix = new Matrix4_default();
1215
- var scratchXDirection = new Cartesian3_default();
1216
- var scratchYDirection = new Cartesian3_default();
1217
- var scratchZDirection = new Cartesian3_default();
1218
- var scratchNegativeX = new Cartesian3_default();
1219
- var scratchNegativeY = new Cartesian3_default();
1220
- var scratchNegativeZ = new Cartesian3_default();
1221
- var frustumSplits = new Array(3);
1222
- var frustumCornersNDC = new Array(4);
1223
- frustumCornersNDC[0] = new Cartesian4_default(-1, -1, 1, 1);
1224
- frustumCornersNDC[1] = new Cartesian4_default(1, -1, 1, 1);
1225
- frustumCornersNDC[2] = new Cartesian4_default(1, 1, 1, 1);
1226
- frustumCornersNDC[3] = new Cartesian4_default(-1, 1, 1, 1);
1227
- var scratchFrustumCorners = new Array(4);
1228
- for (let i = 0; i < 4; ++i) {
1229
- scratchFrustumCorners[i] = new Cartesian4_default();
1230
- }
1231
- FrustumGeometry._computeNearFarPlanes = function(origin, orientation, frustumType, frustum, positions, xDirection, yDirection, zDirection) {
1232
- const rotationMatrix = Matrix3_default.fromQuaternion(
1233
- orientation,
1234
- scratchRotationMatrix
1235
- );
1236
- let x = xDirection ?? scratchXDirection;
1237
- let y = yDirection ?? scratchYDirection;
1238
- let z = zDirection ?? scratchZDirection;
1239
- x = Matrix3_default.getColumn(rotationMatrix, 0, x);
1240
- y = Matrix3_default.getColumn(rotationMatrix, 1, y);
1241
- z = Matrix3_default.getColumn(rotationMatrix, 2, z);
1242
- Cartesian3_default.normalize(x, x);
1243
- Cartesian3_default.normalize(y, y);
1244
- Cartesian3_default.normalize(z, z);
1245
- Cartesian3_default.negate(x, x);
1246
- const view = Matrix4_default.computeView(origin, z, y, x, scratchViewMatrix);
1247
- let inverseView;
1248
- let inverseViewProjection;
1249
- const projection = frustum.projectionMatrix;
1250
- if (frustumType === PERSPECTIVE) {
1251
- const viewProjection = Matrix4_default.multiply(
1252
- projection,
1253
- view,
1254
- scratchInverseMatrix
1255
- );
1256
- inverseViewProjection = Matrix4_default.inverse(
1257
- viewProjection,
1258
- scratchInverseMatrix
1259
- );
1260
- } else {
1261
- inverseView = Matrix4_default.inverseTransformation(view, scratchInverseMatrix);
1262
- }
1263
- if (defined_default(inverseViewProjection)) {
1264
- frustumSplits[0] = frustum.near;
1265
- frustumSplits[1] = frustum.far;
1266
- } else {
1267
- frustumSplits[0] = 0;
1268
- frustumSplits[1] = frustum.near;
1269
- frustumSplits[2] = frustum.far;
1270
- }
1271
- for (let i = 0; i < 2; ++i) {
1272
- for (let j = 0; j < 4; ++j) {
1273
- let corner = Cartesian4_default.clone(
1274
- frustumCornersNDC[j],
1275
- scratchFrustumCorners[j]
1276
- );
1277
- if (!defined_default(inverseViewProjection)) {
1278
- const offCenterFrustum = frustum.offCenterFrustum;
1279
- if (defined_default(offCenterFrustum)) {
1280
- frustum = offCenterFrustum;
1281
- }
1282
- const near = frustumSplits[i];
1283
- const far = frustumSplits[i + 1];
1284
- corner.x = (corner.x * (frustum.right - frustum.left) + frustum.left + frustum.right) * 0.5;
1285
- corner.y = (corner.y * (frustum.top - frustum.bottom) + frustum.bottom + frustum.top) * 0.5;
1286
- corner.z = (corner.z * (near - far) - near - far) * 0.5;
1287
- corner.w = 1;
1288
- Matrix4_default.multiplyByVector(inverseView, corner, corner);
1289
- } else {
1290
- corner = Matrix4_default.multiplyByVector(
1291
- inverseViewProjection,
1292
- corner,
1293
- corner
1294
- );
1295
- const w = 1 / corner.w;
1296
- Cartesian3_default.multiplyByScalar(corner, w, corner);
1297
- Cartesian3_default.subtract(corner, origin, corner);
1298
- Cartesian3_default.normalize(corner, corner);
1299
- const fac = Cartesian3_default.dot(z, corner);
1300
- Cartesian3_default.multiplyByScalar(corner, frustumSplits[i] / fac, corner);
1301
- Cartesian3_default.add(corner, origin, corner);
1302
- }
1303
- positions[12 * i + j * 3] = corner.x;
1304
- positions[12 * i + j * 3 + 1] = corner.y;
1305
- positions[12 * i + j * 3 + 2] = corner.z;
1306
- }
1307
- }
1308
- };
1309
- FrustumGeometry.createGeometry = function(frustumGeometry) {
1310
- const frustumType = frustumGeometry._frustumType;
1311
- const frustum = frustumGeometry._frustum;
1312
- const origin = frustumGeometry._origin;
1313
- const orientation = frustumGeometry._orientation;
1314
- const drawNearPlane = frustumGeometry._drawNearPlane;
1315
- const vertexFormat = frustumGeometry._vertexFormat;
1316
- const numberOfPlanes = drawNearPlane ? 6 : 5;
1317
- let positions = new Float64Array(3 * 4 * 6);
1318
- FrustumGeometry._computeNearFarPlanes(
1319
- origin,
1320
- orientation,
1321
- frustumType,
1322
- frustum,
1323
- positions
1324
- );
1325
- let offset = 3 * 4 * 2;
1326
- positions[offset] = positions[3 * 4];
1327
- positions[offset + 1] = positions[3 * 4 + 1];
1328
- positions[offset + 2] = positions[3 * 4 + 2];
1329
- positions[offset + 3] = positions[0];
1330
- positions[offset + 4] = positions[1];
1331
- positions[offset + 5] = positions[2];
1332
- positions[offset + 6] = positions[3 * 3];
1333
- positions[offset + 7] = positions[3 * 3 + 1];
1334
- positions[offset + 8] = positions[3 * 3 + 2];
1335
- positions[offset + 9] = positions[3 * 7];
1336
- positions[offset + 10] = positions[3 * 7 + 1];
1337
- positions[offset + 11] = positions[3 * 7 + 2];
1338
- offset += 3 * 4;
1339
- positions[offset] = positions[3 * 5];
1340
- positions[offset + 1] = positions[3 * 5 + 1];
1341
- positions[offset + 2] = positions[3 * 5 + 2];
1342
- positions[offset + 3] = positions[3];
1343
- positions[offset + 4] = positions[3 + 1];
1344
- positions[offset + 5] = positions[3 + 2];
1345
- positions[offset + 6] = positions[0];
1346
- positions[offset + 7] = positions[1];
1347
- positions[offset + 8] = positions[2];
1348
- positions[offset + 9] = positions[3 * 4];
1349
- positions[offset + 10] = positions[3 * 4 + 1];
1350
- positions[offset + 11] = positions[3 * 4 + 2];
1351
- offset += 3 * 4;
1352
- positions[offset] = positions[3];
1353
- positions[offset + 1] = positions[3 + 1];
1354
- positions[offset + 2] = positions[3 + 2];
1355
- positions[offset + 3] = positions[3 * 5];
1356
- positions[offset + 4] = positions[3 * 5 + 1];
1357
- positions[offset + 5] = positions[3 * 5 + 2];
1358
- positions[offset + 6] = positions[3 * 6];
1359
- positions[offset + 7] = positions[3 * 6 + 1];
1360
- positions[offset + 8] = positions[3 * 6 + 2];
1361
- positions[offset + 9] = positions[3 * 2];
1362
- positions[offset + 10] = positions[3 * 2 + 1];
1363
- positions[offset + 11] = positions[3 * 2 + 2];
1364
- offset += 3 * 4;
1365
- positions[offset] = positions[3 * 2];
1366
- positions[offset + 1] = positions[3 * 2 + 1];
1367
- positions[offset + 2] = positions[3 * 2 + 2];
1368
- positions[offset + 3] = positions[3 * 6];
1369
- positions[offset + 4] = positions[3 * 6 + 1];
1370
- positions[offset + 5] = positions[3 * 6 + 2];
1371
- positions[offset + 6] = positions[3 * 7];
1372
- positions[offset + 7] = positions[3 * 7 + 1];
1373
- positions[offset + 8] = positions[3 * 7 + 2];
1374
- positions[offset + 9] = positions[3 * 3];
1375
- positions[offset + 10] = positions[3 * 3 + 1];
1376
- positions[offset + 11] = positions[3 * 3 + 2];
1377
- if (!drawNearPlane) {
1378
- positions = positions.subarray(3 * 4);
1379
- }
1380
- const attributes = new GeometryAttributes_default({
1381
- position: new GeometryAttribute_default({
1382
- componentDatatype: ComponentDatatype_default.DOUBLE,
1383
- componentsPerAttribute: 3,
1384
- values: positions
1385
- })
1386
- });
1387
- if (defined_default(vertexFormat.normal) || defined_default(vertexFormat.tangent) || defined_default(vertexFormat.bitangent) || defined_default(vertexFormat.st)) {
1388
- const normals = defined_default(vertexFormat.normal) ? new Float32Array(3 * 4 * numberOfPlanes) : void 0;
1389
- const tangents = defined_default(vertexFormat.tangent) ? new Float32Array(3 * 4 * numberOfPlanes) : void 0;
1390
- const bitangents = defined_default(vertexFormat.bitangent) ? new Float32Array(3 * 4 * numberOfPlanes) : void 0;
1391
- const st = defined_default(vertexFormat.st) ? new Float32Array(2 * 4 * numberOfPlanes) : void 0;
1392
- const x = scratchXDirection;
1393
- const y = scratchYDirection;
1394
- const z = scratchZDirection;
1395
- const negativeX = Cartesian3_default.negate(x, scratchNegativeX);
1396
- const negativeY = Cartesian3_default.negate(y, scratchNegativeY);
1397
- const negativeZ = Cartesian3_default.negate(z, scratchNegativeZ);
1398
- offset = 0;
1399
- if (drawNearPlane) {
1400
- getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y);
1401
- offset += 3 * 4;
1402
- }
1403
- getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y);
1404
- offset += 3 * 4;
1405
- getAttributes(
1406
- offset,
1407
- normals,
1408
- tangents,
1409
- bitangents,
1410
- st,
1411
- negativeX,
1412
- negativeZ,
1413
- y
1414
- );
1415
- offset += 3 * 4;
1416
- getAttributes(
1417
- offset,
1418
- normals,
1419
- tangents,
1420
- bitangents,
1421
- st,
1422
- negativeY,
1423
- negativeZ,
1424
- negativeX
1425
- );
1426
- offset += 3 * 4;
1427
- getAttributes(offset, normals, tangents, bitangents, st, x, z, y);
1428
- offset += 3 * 4;
1429
- getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX);
1430
- if (defined_default(normals)) {
1431
- attributes.normal = new GeometryAttribute_default({
1432
- componentDatatype: ComponentDatatype_default.FLOAT,
1433
- componentsPerAttribute: 3,
1434
- values: normals
1435
- });
1436
- }
1437
- if (defined_default(tangents)) {
1438
- attributes.tangent = new GeometryAttribute_default({
1439
- componentDatatype: ComponentDatatype_default.FLOAT,
1440
- componentsPerAttribute: 3,
1441
- values: tangents
1442
- });
1443
- }
1444
- if (defined_default(bitangents)) {
1445
- attributes.bitangent = new GeometryAttribute_default({
1446
- componentDatatype: ComponentDatatype_default.FLOAT,
1447
- componentsPerAttribute: 3,
1448
- values: bitangents
1449
- });
1450
- }
1451
- if (defined_default(st)) {
1452
- attributes.st = new GeometryAttribute_default({
1453
- componentDatatype: ComponentDatatype_default.FLOAT,
1454
- componentsPerAttribute: 2,
1455
- values: st
1456
- });
1457
- }
1458
- }
1459
- const indices = new Uint16Array(6 * numberOfPlanes);
1460
- for (let i = 0; i < numberOfPlanes; ++i) {
1461
- const indexOffset = i * 6;
1462
- const index = i * 4;
1463
- indices[indexOffset] = index;
1464
- indices[indexOffset + 1] = index + 1;
1465
- indices[indexOffset + 2] = index + 2;
1466
- indices[indexOffset + 3] = index;
1467
- indices[indexOffset + 4] = index + 2;
1468
- indices[indexOffset + 5] = index + 3;
1469
- }
1470
- return new Geometry_default({
1471
- attributes,
1472
- indices,
1473
- primitiveType: PrimitiveType_default.TRIANGLES,
1474
- boundingSphere: BoundingSphere_default.fromVertices(positions)
1475
- });
1476
- };
1477
- var FrustumGeometry_default = FrustumGeometry;
1478
-
1479
- export {
1480
- OrthographicFrustum_default,
1481
- PerspectiveFrustum_default,
1482
- FrustumGeometry_default
1483
- };