@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,1067 +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
- EllipseGeometryLibrary_default
28
- } from "./chunk-7CGEQUM2.js";
29
- import {
30
- GeometryInstance_default
31
- } from "./chunk-VDGOCROW.js";
32
- import {
33
- GeometryPipeline_default
34
- } from "./chunk-KZWFWJML.js";
35
- import {
36
- GeometryOffsetAttribute_default
37
- } from "./chunk-UEY73NRN.js";
38
- import {
39
- VertexFormat_default
40
- } from "./chunk-C7QDUNI3.js";
41
- import {
42
- IndexDatatype_default
43
- } from "./chunk-DZUFEE4L.js";
44
- import {
45
- GeometryAttributes_default
46
- } from "./chunk-IMBVP57H.js";
47
- import {
48
- GeometryAttribute_default,
49
- Geometry_default,
50
- PrimitiveType_default
51
- } from "./chunk-GGNWQWSB.js";
52
- import {
53
- BoundingSphere_default,
54
- GeographicProjection_default
55
- } from "./chunk-6R5X2GUA.js";
56
- import {
57
- Quaternion_default,
58
- Rectangle_default
59
- } from "./chunk-47MCBSXI.js";
60
- import {
61
- ComponentDatatype_default
62
- } from "./chunk-VAL7DYNR.js";
63
- import {
64
- Cartesian2_default,
65
- Cartographic_default,
66
- Ellipsoid_default
67
- } from "./chunk-UTB7U3O6.js";
68
- import {
69
- Cartesian3_default,
70
- Frozen_default,
71
- Matrix3_default
72
- } from "./chunk-ZQLZG4IN.js";
73
- import {
74
- Math_default
75
- } from "./chunk-5YPQBFRD.js";
76
- import {
77
- Check_default,
78
- DeveloperError_default
79
- } from "./chunk-6YR6JBMY.js";
80
- import {
81
- defined_default
82
- } from "./chunk-AHWAZRBV.js";
83
-
84
- // packages/engine/Source/Core/EllipseGeometry.js
85
- var scratchCartesian1 = new Cartesian3_default();
86
- var scratchCartesian2 = new Cartesian3_default();
87
- var scratchCartesian3 = new Cartesian3_default();
88
- var scratchCartesian4 = new Cartesian3_default();
89
- var texCoordScratch = new Cartesian2_default();
90
- var textureMatrixScratch = new Matrix3_default();
91
- var tangentMatrixScratch = new Matrix3_default();
92
- var quaternionScratch = new Quaternion_default();
93
- var scratchNormal = new Cartesian3_default();
94
- var scratchTangent = new Cartesian3_default();
95
- var scratchBitangent = new Cartesian3_default();
96
- var scratchCartographic = new Cartographic_default();
97
- var projectedCenterScratch = new Cartesian3_default();
98
- var scratchMinTexCoord = new Cartesian2_default();
99
- var scratchMaxTexCoord = new Cartesian2_default();
100
- function computeTopBottomAttributes(positions, options, extrude) {
101
- const vertexFormat = options.vertexFormat;
102
- const center = options.center;
103
- const semiMajorAxis = options.semiMajorAxis;
104
- const semiMinorAxis = options.semiMinorAxis;
105
- const ellipsoid = options.ellipsoid;
106
- const stRotation = options.stRotation;
107
- const size = extrude ? positions.length / 3 * 2 : positions.length / 3;
108
- const shadowVolume = options.shadowVolume;
109
- const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
110
- const normals = vertexFormat.normal ? new Float32Array(size * 3) : void 0;
111
- const tangents = vertexFormat.tangent ? new Float32Array(size * 3) : void 0;
112
- const bitangents = vertexFormat.bitangent ? new Float32Array(size * 3) : void 0;
113
- const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : void 0;
114
- let textureCoordIndex = 0;
115
- let normal = scratchNormal;
116
- let tangent = scratchTangent;
117
- let bitangent = scratchBitangent;
118
- const projection = new GeographicProjection_default(ellipsoid);
119
- const projectedCenter = projection.project(
120
- ellipsoid.cartesianToCartographic(center, scratchCartographic),
121
- projectedCenterScratch
122
- );
123
- const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
124
- center,
125
- scratchCartesian1
126
- );
127
- ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
128
- let textureMatrix = textureMatrixScratch;
129
- let tangentMatrix = tangentMatrixScratch;
130
- if (stRotation !== 0) {
131
- let rotation = Quaternion_default.fromAxisAngle(
132
- geodeticNormal,
133
- stRotation,
134
- quaternionScratch
135
- );
136
- textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
137
- rotation = Quaternion_default.fromAxisAngle(
138
- geodeticNormal,
139
- -stRotation,
140
- quaternionScratch
141
- );
142
- tangentMatrix = Matrix3_default.fromQuaternion(rotation, tangentMatrix);
143
- } else {
144
- textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
145
- tangentMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, tangentMatrix);
146
- }
147
- const minTexCoord = Cartesian2_default.fromElements(
148
- Number.POSITIVE_INFINITY,
149
- Number.POSITIVE_INFINITY,
150
- scratchMinTexCoord
151
- );
152
- const maxTexCoord = Cartesian2_default.fromElements(
153
- Number.NEGATIVE_INFINITY,
154
- Number.NEGATIVE_INFINITY,
155
- scratchMaxTexCoord
156
- );
157
- let length = positions.length;
158
- const bottomOffset = extrude ? length : 0;
159
- const stOffset = bottomOffset / 3 * 2;
160
- for (let i = 0; i < length; i += 3) {
161
- const i1 = i + 1;
162
- const i2 = i + 2;
163
- const position = Cartesian3_default.fromArray(positions, i, scratchCartesian1);
164
- if (vertexFormat.st) {
165
- const rotatedPoint = Matrix3_default.multiplyByVector(
166
- textureMatrix,
167
- position,
168
- scratchCartesian2
169
- );
170
- const projectedPoint = projection.project(
171
- ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),
172
- scratchCartesian3
173
- );
174
- Cartesian3_default.subtract(projectedPoint, projectedCenter, projectedPoint);
175
- texCoordScratch.x = (projectedPoint.x + semiMajorAxis) / (2 * semiMajorAxis);
176
- texCoordScratch.y = (projectedPoint.y + semiMinorAxis) / (2 * semiMinorAxis);
177
- minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
178
- minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
179
- maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
180
- maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
181
- if (extrude) {
182
- textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
183
- textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;
184
- }
185
- textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
186
- textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
187
- }
188
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
189
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
190
- if (shadowVolume) {
191
- extrudeNormals[i + bottomOffset] = -normal.x;
192
- extrudeNormals[i1 + bottomOffset] = -normal.y;
193
- extrudeNormals[i2 + bottomOffset] = -normal.z;
194
- }
195
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
196
- if (vertexFormat.tangent || vertexFormat.bitangent) {
197
- tangent = Cartesian3_default.normalize(
198
- Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent),
199
- tangent
200
- );
201
- Matrix3_default.multiplyByVector(tangentMatrix, tangent, tangent);
202
- }
203
- if (vertexFormat.normal) {
204
- normals[i] = normal.x;
205
- normals[i1] = normal.y;
206
- normals[i2] = normal.z;
207
- if (extrude) {
208
- normals[i + bottomOffset] = -normal.x;
209
- normals[i1 + bottomOffset] = -normal.y;
210
- normals[i2 + bottomOffset] = -normal.z;
211
- }
212
- }
213
- if (vertexFormat.tangent) {
214
- tangents[i] = tangent.x;
215
- tangents[i1] = tangent.y;
216
- tangents[i2] = tangent.z;
217
- if (extrude) {
218
- tangents[i + bottomOffset] = -tangent.x;
219
- tangents[i1 + bottomOffset] = -tangent.y;
220
- tangents[i2 + bottomOffset] = -tangent.z;
221
- }
222
- }
223
- if (vertexFormat.bitangent) {
224
- bitangent = Cartesian3_default.normalize(
225
- Cartesian3_default.cross(normal, tangent, bitangent),
226
- bitangent
227
- );
228
- bitangents[i] = bitangent.x;
229
- bitangents[i1] = bitangent.y;
230
- bitangents[i2] = bitangent.z;
231
- if (extrude) {
232
- bitangents[i + bottomOffset] = bitangent.x;
233
- bitangents[i1 + bottomOffset] = bitangent.y;
234
- bitangents[i2 + bottomOffset] = bitangent.z;
235
- }
236
- }
237
- }
238
- }
239
- }
240
- if (vertexFormat.st) {
241
- length = textureCoordinates.length;
242
- for (let k = 0; k < length; k += 2) {
243
- textureCoordinates[k] = (textureCoordinates[k] - minTexCoord.x) / (maxTexCoord.x - minTexCoord.x);
244
- textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minTexCoord.y) / (maxTexCoord.y - minTexCoord.y);
245
- }
246
- }
247
- const attributes = new GeometryAttributes_default();
248
- if (vertexFormat.position) {
249
- const finalPositions = EllipseGeometryLibrary_default.raisePositionsToHeight(
250
- positions,
251
- options,
252
- extrude
253
- );
254
- attributes.position = new GeometryAttribute_default({
255
- componentDatatype: ComponentDatatype_default.DOUBLE,
256
- componentsPerAttribute: 3,
257
- values: finalPositions
258
- });
259
- }
260
- if (vertexFormat.st) {
261
- attributes.st = new GeometryAttribute_default({
262
- componentDatatype: ComponentDatatype_default.FLOAT,
263
- componentsPerAttribute: 2,
264
- values: textureCoordinates
265
- });
266
- }
267
- if (vertexFormat.normal) {
268
- attributes.normal = new GeometryAttribute_default({
269
- componentDatatype: ComponentDatatype_default.FLOAT,
270
- componentsPerAttribute: 3,
271
- values: normals
272
- });
273
- }
274
- if (vertexFormat.tangent) {
275
- attributes.tangent = new GeometryAttribute_default({
276
- componentDatatype: ComponentDatatype_default.FLOAT,
277
- componentsPerAttribute: 3,
278
- values: tangents
279
- });
280
- }
281
- if (vertexFormat.bitangent) {
282
- attributes.bitangent = new GeometryAttribute_default({
283
- componentDatatype: ComponentDatatype_default.FLOAT,
284
- componentsPerAttribute: 3,
285
- values: bitangents
286
- });
287
- }
288
- if (shadowVolume) {
289
- attributes.extrudeDirection = new GeometryAttribute_default({
290
- componentDatatype: ComponentDatatype_default.FLOAT,
291
- componentsPerAttribute: 3,
292
- values: extrudeNormals
293
- });
294
- }
295
- if (extrude && defined_default(options.offsetAttribute)) {
296
- let offsetAttribute = new Uint8Array(size);
297
- if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
298
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
299
- } else {
300
- const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
301
- offsetAttribute = offsetAttribute.fill(offsetValue);
302
- }
303
- attributes.applyOffset = new GeometryAttribute_default({
304
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
305
- componentsPerAttribute: 1,
306
- values: offsetAttribute
307
- });
308
- }
309
- return attributes;
310
- }
311
- function topIndices(numPts) {
312
- const indices = new Array(12 * (numPts * (numPts + 1)) - 6);
313
- let indicesIndex = 0;
314
- let prevIndex;
315
- let numInterior;
316
- let positionIndex;
317
- let i;
318
- let j;
319
- prevIndex = 0;
320
- positionIndex = 1;
321
- for (i = 0; i < 3; i++) {
322
- indices[indicesIndex++] = positionIndex++;
323
- indices[indicesIndex++] = prevIndex;
324
- indices[indicesIndex++] = positionIndex;
325
- }
326
- for (i = 2; i < numPts + 1; ++i) {
327
- positionIndex = i * (i + 1) - 1;
328
- prevIndex = (i - 1) * i - 1;
329
- indices[indicesIndex++] = positionIndex++;
330
- indices[indicesIndex++] = prevIndex;
331
- indices[indicesIndex++] = positionIndex;
332
- numInterior = 2 * i;
333
- for (j = 0; j < numInterior - 1; ++j) {
334
- indices[indicesIndex++] = positionIndex;
335
- indices[indicesIndex++] = prevIndex++;
336
- indices[indicesIndex++] = prevIndex;
337
- indices[indicesIndex++] = positionIndex++;
338
- indices[indicesIndex++] = prevIndex;
339
- indices[indicesIndex++] = positionIndex;
340
- }
341
- indices[indicesIndex++] = positionIndex++;
342
- indices[indicesIndex++] = prevIndex;
343
- indices[indicesIndex++] = positionIndex;
344
- }
345
- numInterior = numPts * 2;
346
- ++positionIndex;
347
- ++prevIndex;
348
- for (i = 0; i < numInterior - 1; ++i) {
349
- indices[indicesIndex++] = positionIndex;
350
- indices[indicesIndex++] = prevIndex++;
351
- indices[indicesIndex++] = prevIndex;
352
- indices[indicesIndex++] = positionIndex++;
353
- indices[indicesIndex++] = prevIndex;
354
- indices[indicesIndex++] = positionIndex;
355
- }
356
- indices[indicesIndex++] = positionIndex;
357
- indices[indicesIndex++] = prevIndex++;
358
- indices[indicesIndex++] = prevIndex;
359
- indices[indicesIndex++] = positionIndex++;
360
- indices[indicesIndex++] = prevIndex++;
361
- indices[indicesIndex++] = prevIndex;
362
- ++prevIndex;
363
- for (i = numPts - 1; i > 1; --i) {
364
- indices[indicesIndex++] = prevIndex++;
365
- indices[indicesIndex++] = prevIndex;
366
- indices[indicesIndex++] = positionIndex;
367
- numInterior = 2 * i;
368
- for (j = 0; j < numInterior - 1; ++j) {
369
- indices[indicesIndex++] = positionIndex;
370
- indices[indicesIndex++] = prevIndex++;
371
- indices[indicesIndex++] = prevIndex;
372
- indices[indicesIndex++] = positionIndex++;
373
- indices[indicesIndex++] = prevIndex;
374
- indices[indicesIndex++] = positionIndex;
375
- }
376
- indices[indicesIndex++] = prevIndex++;
377
- indices[indicesIndex++] = prevIndex++;
378
- indices[indicesIndex++] = positionIndex++;
379
- }
380
- for (i = 0; i < 3; i++) {
381
- indices[indicesIndex++] = prevIndex++;
382
- indices[indicesIndex++] = prevIndex;
383
- indices[indicesIndex++] = positionIndex;
384
- }
385
- return indices;
386
- }
387
- var boundingSphereCenter = new Cartesian3_default();
388
- function computeEllipse(options) {
389
- const center = options.center;
390
- boundingSphereCenter = Cartesian3_default.multiplyByScalar(
391
- options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
392
- options.height,
393
- boundingSphereCenter
394
- );
395
- boundingSphereCenter = Cartesian3_default.add(
396
- center,
397
- boundingSphereCenter,
398
- boundingSphereCenter
399
- );
400
- const boundingSphere = new BoundingSphere_default(
401
- boundingSphereCenter,
402
- options.semiMajorAxis
403
- );
404
- const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
405
- options,
406
- true,
407
- false
408
- );
409
- const positions = cep.positions;
410
- const numPts = cep.numPts;
411
- const attributes = computeTopBottomAttributes(positions, options, false);
412
- let indices = topIndices(numPts);
413
- indices = IndexDatatype_default.createTypedArray(positions.length / 3, indices);
414
- return {
415
- boundingSphere,
416
- attributes,
417
- indices
418
- };
419
- }
420
- function computeWallAttributes(positions, options) {
421
- const vertexFormat = options.vertexFormat;
422
- const center = options.center;
423
- const semiMajorAxis = options.semiMajorAxis;
424
- const semiMinorAxis = options.semiMinorAxis;
425
- const ellipsoid = options.ellipsoid;
426
- const height = options.height;
427
- const extrudedHeight = options.extrudedHeight;
428
- const stRotation = options.stRotation;
429
- const size = positions.length / 3 * 2;
430
- const finalPositions = new Float64Array(size * 3);
431
- const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
432
- const normals = vertexFormat.normal ? new Float32Array(size * 3) : void 0;
433
- const tangents = vertexFormat.tangent ? new Float32Array(size * 3) : void 0;
434
- const bitangents = vertexFormat.bitangent ? new Float32Array(size * 3) : void 0;
435
- const shadowVolume = options.shadowVolume;
436
- const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : void 0;
437
- let textureCoordIndex = 0;
438
- let normal = scratchNormal;
439
- let tangent = scratchTangent;
440
- let bitangent = scratchBitangent;
441
- const projection = new GeographicProjection_default(ellipsoid);
442
- const projectedCenter = projection.project(
443
- ellipsoid.cartesianToCartographic(center, scratchCartographic),
444
- projectedCenterScratch
445
- );
446
- const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
447
- center,
448
- scratchCartesian1
449
- );
450
- ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
451
- const rotation = Quaternion_default.fromAxisAngle(
452
- geodeticNormal,
453
- stRotation,
454
- quaternionScratch
455
- );
456
- const textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrixScratch);
457
- const minTexCoord = Cartesian2_default.fromElements(
458
- Number.POSITIVE_INFINITY,
459
- Number.POSITIVE_INFINITY,
460
- scratchMinTexCoord
461
- );
462
- const maxTexCoord = Cartesian2_default.fromElements(
463
- Number.NEGATIVE_INFINITY,
464
- Number.NEGATIVE_INFINITY,
465
- scratchMaxTexCoord
466
- );
467
- let length = positions.length;
468
- const stOffset = length / 3 * 2;
469
- for (let i = 0; i < length; i += 3) {
470
- const i1 = i + 1;
471
- const i2 = i + 2;
472
- let position = Cartesian3_default.fromArray(positions, i, scratchCartesian1);
473
- let extrudedPosition;
474
- if (vertexFormat.st) {
475
- const rotatedPoint = Matrix3_default.multiplyByVector(
476
- textureMatrix,
477
- position,
478
- scratchCartesian2
479
- );
480
- const projectedPoint = projection.project(
481
- ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),
482
- scratchCartesian3
483
- );
484
- Cartesian3_default.subtract(projectedPoint, projectedCenter, projectedPoint);
485
- texCoordScratch.x = (projectedPoint.x + semiMajorAxis) / (2 * semiMajorAxis);
486
- texCoordScratch.y = (projectedPoint.y + semiMinorAxis) / (2 * semiMinorAxis);
487
- minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
488
- minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
489
- maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
490
- maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
491
- textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
492
- textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;
493
- textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
494
- textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
495
- }
496
- position = ellipsoid.scaleToGeodeticSurface(position, position);
497
- extrudedPosition = Cartesian3_default.clone(position, scratchCartesian2);
498
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
499
- if (shadowVolume) {
500
- extrudeNormals[i + length] = -normal.x;
501
- extrudeNormals[i1 + length] = -normal.y;
502
- extrudeNormals[i2 + length] = -normal.z;
503
- }
504
- let scaledNormal = Cartesian3_default.multiplyByScalar(
505
- normal,
506
- height,
507
- scratchCartesian4
508
- );
509
- position = Cartesian3_default.add(position, scaledNormal, position);
510
- scaledNormal = Cartesian3_default.multiplyByScalar(
511
- normal,
512
- extrudedHeight,
513
- scaledNormal
514
- );
515
- extrudedPosition = Cartesian3_default.add(
516
- extrudedPosition,
517
- scaledNormal,
518
- extrudedPosition
519
- );
520
- if (vertexFormat.position) {
521
- finalPositions[i + length] = extrudedPosition.x;
522
- finalPositions[i1 + length] = extrudedPosition.y;
523
- finalPositions[i2 + length] = extrudedPosition.z;
524
- finalPositions[i] = position.x;
525
- finalPositions[i1] = position.y;
526
- finalPositions[i2] = position.z;
527
- }
528
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
529
- bitangent = Cartesian3_default.clone(normal, bitangent);
530
- const next = Cartesian3_default.fromArray(
531
- positions,
532
- (i + 3) % length,
533
- scratchCartesian4
534
- );
535
- Cartesian3_default.subtract(next, position, next);
536
- const bottom = Cartesian3_default.subtract(
537
- extrudedPosition,
538
- position,
539
- scratchCartesian3
540
- );
541
- normal = Cartesian3_default.normalize(
542
- Cartesian3_default.cross(bottom, next, normal),
543
- normal
544
- );
545
- if (vertexFormat.normal) {
546
- normals[i] = normal.x;
547
- normals[i1] = normal.y;
548
- normals[i2] = normal.z;
549
- normals[i + length] = normal.x;
550
- normals[i1 + length] = normal.y;
551
- normals[i2 + length] = normal.z;
552
- }
553
- if (vertexFormat.tangent) {
554
- tangent = Cartesian3_default.normalize(
555
- Cartesian3_default.cross(bitangent, normal, tangent),
556
- tangent
557
- );
558
- tangents[i] = tangent.x;
559
- tangents[i1] = tangent.y;
560
- tangents[i2] = tangent.z;
561
- tangents[i + length] = tangent.x;
562
- tangents[i + 1 + length] = tangent.y;
563
- tangents[i + 2 + length] = tangent.z;
564
- }
565
- if (vertexFormat.bitangent) {
566
- bitangents[i] = bitangent.x;
567
- bitangents[i1] = bitangent.y;
568
- bitangents[i2] = bitangent.z;
569
- bitangents[i + length] = bitangent.x;
570
- bitangents[i1 + length] = bitangent.y;
571
- bitangents[i2 + length] = bitangent.z;
572
- }
573
- }
574
- }
575
- if (vertexFormat.st) {
576
- length = textureCoordinates.length;
577
- for (let k = 0; k < length; k += 2) {
578
- textureCoordinates[k] = (textureCoordinates[k] - minTexCoord.x) / (maxTexCoord.x - minTexCoord.x);
579
- textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minTexCoord.y) / (maxTexCoord.y - minTexCoord.y);
580
- }
581
- }
582
- const attributes = new GeometryAttributes_default();
583
- if (vertexFormat.position) {
584
- attributes.position = new GeometryAttribute_default({
585
- componentDatatype: ComponentDatatype_default.DOUBLE,
586
- componentsPerAttribute: 3,
587
- values: finalPositions
588
- });
589
- }
590
- if (vertexFormat.st) {
591
- attributes.st = new GeometryAttribute_default({
592
- componentDatatype: ComponentDatatype_default.FLOAT,
593
- componentsPerAttribute: 2,
594
- values: textureCoordinates
595
- });
596
- }
597
- if (vertexFormat.normal) {
598
- attributes.normal = new GeometryAttribute_default({
599
- componentDatatype: ComponentDatatype_default.FLOAT,
600
- componentsPerAttribute: 3,
601
- values: normals
602
- });
603
- }
604
- if (vertexFormat.tangent) {
605
- attributes.tangent = new GeometryAttribute_default({
606
- componentDatatype: ComponentDatatype_default.FLOAT,
607
- componentsPerAttribute: 3,
608
- values: tangents
609
- });
610
- }
611
- if (vertexFormat.bitangent) {
612
- attributes.bitangent = new GeometryAttribute_default({
613
- componentDatatype: ComponentDatatype_default.FLOAT,
614
- componentsPerAttribute: 3,
615
- values: bitangents
616
- });
617
- }
618
- if (shadowVolume) {
619
- attributes.extrudeDirection = new GeometryAttribute_default({
620
- componentDatatype: ComponentDatatype_default.FLOAT,
621
- componentsPerAttribute: 3,
622
- values: extrudeNormals
623
- });
624
- }
625
- if (defined_default(options.offsetAttribute)) {
626
- let offsetAttribute = new Uint8Array(size);
627
- if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
628
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
629
- } else {
630
- const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
631
- offsetAttribute = offsetAttribute.fill(offsetValue);
632
- }
633
- attributes.applyOffset = new GeometryAttribute_default({
634
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
635
- componentsPerAttribute: 1,
636
- values: offsetAttribute
637
- });
638
- }
639
- return attributes;
640
- }
641
- function computeWallIndices(positions) {
642
- const length = positions.length / 3;
643
- const indices = IndexDatatype_default.createTypedArray(length, length * 6);
644
- let index = 0;
645
- for (let i = 0; i < length; i++) {
646
- const UL = i;
647
- const LL = i + length;
648
- const UR = (UL + 1) % length;
649
- const LR = UR + length;
650
- indices[index++] = UL;
651
- indices[index++] = LL;
652
- indices[index++] = UR;
653
- indices[index++] = UR;
654
- indices[index++] = LL;
655
- indices[index++] = LR;
656
- }
657
- return indices;
658
- }
659
- var topBoundingSphere = new BoundingSphere_default();
660
- var bottomBoundingSphere = new BoundingSphere_default();
661
- function computeExtrudedEllipse(options) {
662
- const center = options.center;
663
- const ellipsoid = options.ellipsoid;
664
- const semiMajorAxis = options.semiMajorAxis;
665
- let scaledNormal = Cartesian3_default.multiplyByScalar(
666
- ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),
667
- options.height,
668
- scratchCartesian1
669
- );
670
- topBoundingSphere.center = Cartesian3_default.add(
671
- center,
672
- scaledNormal,
673
- topBoundingSphere.center
674
- );
675
- topBoundingSphere.radius = semiMajorAxis;
676
- scaledNormal = Cartesian3_default.multiplyByScalar(
677
- ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
678
- options.extrudedHeight,
679
- scaledNormal
680
- );
681
- bottomBoundingSphere.center = Cartesian3_default.add(
682
- center,
683
- scaledNormal,
684
- bottomBoundingSphere.center
685
- );
686
- bottomBoundingSphere.radius = semiMajorAxis;
687
- const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
688
- options,
689
- true,
690
- true
691
- );
692
- const positions = cep.positions;
693
- const numPts = cep.numPts;
694
- const outerPositions = cep.outerPositions;
695
- const boundingSphere = BoundingSphere_default.union(
696
- topBoundingSphere,
697
- bottomBoundingSphere
698
- );
699
- const topBottomAttributes = computeTopBottomAttributes(
700
- positions,
701
- options,
702
- true
703
- );
704
- let indices = topIndices(numPts);
705
- const length = indices.length;
706
- indices.length = length * 2;
707
- const posLength = positions.length / 3;
708
- for (let i = 0; i < length; i += 3) {
709
- indices[i + length] = indices[i + 2] + posLength;
710
- indices[i + 1 + length] = indices[i + 1] + posLength;
711
- indices[i + 2 + length] = indices[i] + posLength;
712
- }
713
- const topBottomIndices = IndexDatatype_default.createTypedArray(
714
- posLength * 2 / 3,
715
- indices
716
- );
717
- const topBottomGeo = new Geometry_default({
718
- attributes: topBottomAttributes,
719
- indices: topBottomIndices,
720
- primitiveType: PrimitiveType_default.TRIANGLES
721
- });
722
- const wallAttributes = computeWallAttributes(outerPositions, options);
723
- indices = computeWallIndices(outerPositions);
724
- const wallIndices = IndexDatatype_default.createTypedArray(
725
- outerPositions.length * 2 / 3,
726
- indices
727
- );
728
- const wallGeo = new Geometry_default({
729
- attributes: wallAttributes,
730
- indices: wallIndices,
731
- primitiveType: PrimitiveType_default.TRIANGLES
732
- });
733
- const geo = GeometryPipeline_default.combineInstances([
734
- new GeometryInstance_default({
735
- geometry: topBottomGeo
736
- }),
737
- new GeometryInstance_default({
738
- geometry: wallGeo
739
- })
740
- ]);
741
- return {
742
- boundingSphere,
743
- attributes: geo[0].attributes,
744
- indices: geo[0].indices
745
- };
746
- }
747
- function computeRectangle(center, semiMajorAxis, semiMinorAxis, rotation, granularity, ellipsoid, result) {
748
- const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
749
- {
750
- center,
751
- semiMajorAxis,
752
- semiMinorAxis,
753
- rotation,
754
- granularity
755
- },
756
- false,
757
- true
758
- );
759
- const positionsFlat = cep.outerPositions;
760
- const positionsCount = positionsFlat.length / 3;
761
- const positions = new Array(positionsCount);
762
- for (let i = 0; i < positionsCount; ++i) {
763
- positions[i] = Cartesian3_default.fromArray(positionsFlat, i * 3);
764
- }
765
- const rectangle = Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
766
- if (rectangle.width > Math_default.PI) {
767
- rectangle.north = rectangle.north > 0 ? Math_default.PI_OVER_TWO - Math_default.EPSILON7 : rectangle.north;
768
- rectangle.south = rectangle.south < 0 ? Math_default.EPSILON7 - Math_default.PI_OVER_TWO : rectangle.south;
769
- rectangle.east = Math_default.PI;
770
- rectangle.west = -Math_default.PI;
771
- }
772
- return rectangle;
773
- }
774
- function EllipseGeometry(options) {
775
- options = options ?? Frozen_default.EMPTY_OBJECT;
776
- const center = options.center;
777
- const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
778
- const semiMajorAxis = options.semiMajorAxis;
779
- const semiMinorAxis = options.semiMinorAxis;
780
- const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
781
- const vertexFormat = options.vertexFormat ?? VertexFormat_default.DEFAULT;
782
- Check_default.defined("options.center", center);
783
- Check_default.typeOf.number("options.semiMajorAxis", semiMajorAxis);
784
- Check_default.typeOf.number("options.semiMinorAxis", semiMinorAxis);
785
- if (semiMajorAxis < semiMinorAxis) {
786
- throw new DeveloperError_default(
787
- "semiMajorAxis must be greater than or equal to the semiMinorAxis."
788
- );
789
- }
790
- if (granularity <= 0) {
791
- throw new DeveloperError_default("granularity must be greater than zero.");
792
- }
793
- const height = options.height ?? 0;
794
- const extrudedHeight = options.extrudedHeight ?? height;
795
- this._center = Cartesian3_default.clone(center);
796
- this._semiMajorAxis = semiMajorAxis;
797
- this._semiMinorAxis = semiMinorAxis;
798
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
799
- this._rotation = options.rotation ?? 0;
800
- this._stRotation = options.stRotation ?? 0;
801
- this._height = Math.max(extrudedHeight, height);
802
- this._granularity = granularity;
803
- this._vertexFormat = VertexFormat_default.clone(vertexFormat);
804
- this._extrudedHeight = Math.min(extrudedHeight, height);
805
- this._shadowVolume = options.shadowVolume ?? false;
806
- this._workerName = "createEllipseGeometry";
807
- this._offsetAttribute = options.offsetAttribute;
808
- this._rectangle = void 0;
809
- this._textureCoordinateRotationPoints = void 0;
810
- }
811
- EllipseGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 9;
812
- EllipseGeometry.pack = function(value, array, startingIndex) {
813
- Check_default.defined("value", value);
814
- Check_default.defined("array", array);
815
- startingIndex = startingIndex ?? 0;
816
- Cartesian3_default.pack(value._center, array, startingIndex);
817
- startingIndex += Cartesian3_default.packedLength;
818
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
819
- startingIndex += Ellipsoid_default.packedLength;
820
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
821
- startingIndex += VertexFormat_default.packedLength;
822
- array[startingIndex++] = value._semiMajorAxis;
823
- array[startingIndex++] = value._semiMinorAxis;
824
- array[startingIndex++] = value._rotation;
825
- array[startingIndex++] = value._stRotation;
826
- array[startingIndex++] = value._height;
827
- array[startingIndex++] = value._granularity;
828
- array[startingIndex++] = value._extrudedHeight;
829
- array[startingIndex++] = value._shadowVolume ? 1 : 0;
830
- array[startingIndex] = value._offsetAttribute ?? -1;
831
- return array;
832
- };
833
- var scratchCenter = new Cartesian3_default();
834
- var scratchEllipsoid = new Ellipsoid_default();
835
- var scratchVertexFormat = new VertexFormat_default();
836
- var scratchOptions = {
837
- center: scratchCenter,
838
- ellipsoid: scratchEllipsoid,
839
- vertexFormat: scratchVertexFormat,
840
- semiMajorAxis: void 0,
841
- semiMinorAxis: void 0,
842
- rotation: void 0,
843
- stRotation: void 0,
844
- height: void 0,
845
- granularity: void 0,
846
- extrudedHeight: void 0,
847
- shadowVolume: void 0,
848
- offsetAttribute: void 0
849
- };
850
- EllipseGeometry.unpack = function(array, startingIndex, result) {
851
- Check_default.defined("array", array);
852
- startingIndex = startingIndex ?? 0;
853
- const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter);
854
- startingIndex += Cartesian3_default.packedLength;
855
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
856
- startingIndex += Ellipsoid_default.packedLength;
857
- const vertexFormat = VertexFormat_default.unpack(
858
- array,
859
- startingIndex,
860
- scratchVertexFormat
861
- );
862
- startingIndex += VertexFormat_default.packedLength;
863
- const semiMajorAxis = array[startingIndex++];
864
- const semiMinorAxis = array[startingIndex++];
865
- const rotation = array[startingIndex++];
866
- const stRotation = array[startingIndex++];
867
- const height = array[startingIndex++];
868
- const granularity = array[startingIndex++];
869
- const extrudedHeight = array[startingIndex++];
870
- const shadowVolume = array[startingIndex++] === 1;
871
- const offsetAttribute = array[startingIndex];
872
- if (!defined_default(result)) {
873
- scratchOptions.height = height;
874
- scratchOptions.extrudedHeight = extrudedHeight;
875
- scratchOptions.granularity = granularity;
876
- scratchOptions.stRotation = stRotation;
877
- scratchOptions.rotation = rotation;
878
- scratchOptions.semiMajorAxis = semiMajorAxis;
879
- scratchOptions.semiMinorAxis = semiMinorAxis;
880
- scratchOptions.shadowVolume = shadowVolume;
881
- scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
882
- return new EllipseGeometry(scratchOptions);
883
- }
884
- result._center = Cartesian3_default.clone(center, result._center);
885
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
886
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
887
- result._semiMajorAxis = semiMajorAxis;
888
- result._semiMinorAxis = semiMinorAxis;
889
- result._rotation = rotation;
890
- result._stRotation = stRotation;
891
- result._height = height;
892
- result._granularity = granularity;
893
- result._extrudedHeight = extrudedHeight;
894
- result._shadowVolume = shadowVolume;
895
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
896
- return result;
897
- };
898
- EllipseGeometry.computeRectangle = function(options, result) {
899
- options = options ?? Frozen_default.EMPTY_OBJECT;
900
- const center = options.center;
901
- const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
902
- const semiMajorAxis = options.semiMajorAxis;
903
- const semiMinorAxis = options.semiMinorAxis;
904
- const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
905
- const rotation = options.rotation ?? 0;
906
- Check_default.defined("options.center", center);
907
- Check_default.typeOf.number("options.semiMajorAxis", semiMajorAxis);
908
- Check_default.typeOf.number("options.semiMinorAxis", semiMinorAxis);
909
- if (semiMajorAxis < semiMinorAxis) {
910
- throw new DeveloperError_default(
911
- "semiMajorAxis must be greater than or equal to the semiMinorAxis."
912
- );
913
- }
914
- if (granularity <= 0) {
915
- throw new DeveloperError_default("granularity must be greater than zero.");
916
- }
917
- return computeRectangle(
918
- center,
919
- semiMajorAxis,
920
- semiMinorAxis,
921
- rotation,
922
- granularity,
923
- ellipsoid,
924
- result
925
- );
926
- };
927
- EllipseGeometry.createGeometry = function(ellipseGeometry) {
928
- if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
929
- return;
930
- }
931
- const height = ellipseGeometry._height;
932
- const extrudedHeight = ellipseGeometry._extrudedHeight;
933
- const extrude = !Math_default.equalsEpsilon(
934
- height,
935
- extrudedHeight,
936
- 0,
937
- Math_default.EPSILON2
938
- );
939
- ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
940
- ellipseGeometry._center,
941
- ellipseGeometry._center
942
- );
943
- const options = {
944
- center: ellipseGeometry._center,
945
- semiMajorAxis: ellipseGeometry._semiMajorAxis,
946
- semiMinorAxis: ellipseGeometry._semiMinorAxis,
947
- ellipsoid: ellipseGeometry._ellipsoid,
948
- rotation: ellipseGeometry._rotation,
949
- height,
950
- granularity: ellipseGeometry._granularity,
951
- vertexFormat: ellipseGeometry._vertexFormat,
952
- stRotation: ellipseGeometry._stRotation
953
- };
954
- let geometry;
955
- if (extrude) {
956
- options.extrudedHeight = extrudedHeight;
957
- options.shadowVolume = ellipseGeometry._shadowVolume;
958
- options.offsetAttribute = ellipseGeometry._offsetAttribute;
959
- geometry = computeExtrudedEllipse(options);
960
- } else {
961
- geometry = computeEllipse(options);
962
- if (defined_default(ellipseGeometry._offsetAttribute)) {
963
- const length = geometry.attributes.position.values.length;
964
- const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
965
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
966
- geometry.attributes.applyOffset = new GeometryAttribute_default({
967
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
968
- componentsPerAttribute: 1,
969
- values: applyOffset
970
- });
971
- }
972
- }
973
- return new Geometry_default({
974
- attributes: geometry.attributes,
975
- indices: geometry.indices,
976
- primitiveType: PrimitiveType_default.TRIANGLES,
977
- boundingSphere: geometry.boundingSphere,
978
- offsetAttribute: ellipseGeometry._offsetAttribute
979
- });
980
- };
981
- EllipseGeometry.createShadowVolume = function(ellipseGeometry, minHeightFunc, maxHeightFunc) {
982
- const granularity = ellipseGeometry._granularity;
983
- const ellipsoid = ellipseGeometry._ellipsoid;
984
- const minHeight = minHeightFunc(granularity, ellipsoid);
985
- const maxHeight = maxHeightFunc(granularity, ellipsoid);
986
- return new EllipseGeometry({
987
- center: ellipseGeometry._center,
988
- semiMajorAxis: ellipseGeometry._semiMajorAxis,
989
- semiMinorAxis: ellipseGeometry._semiMinorAxis,
990
- ellipsoid,
991
- rotation: ellipseGeometry._rotation,
992
- stRotation: ellipseGeometry._stRotation,
993
- granularity,
994
- extrudedHeight: minHeight,
995
- height: maxHeight,
996
- vertexFormat: VertexFormat_default.POSITION_ONLY,
997
- shadowVolume: true
998
- });
999
- };
1000
- function textureCoordinateRotationPoints(ellipseGeometry) {
1001
- const stRotation = -ellipseGeometry._stRotation;
1002
- if (stRotation === 0) {
1003
- return [0, 0, 0, 1, 1, 0];
1004
- }
1005
- const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
1006
- {
1007
- center: ellipseGeometry._center,
1008
- semiMajorAxis: ellipseGeometry._semiMajorAxis,
1009
- semiMinorAxis: ellipseGeometry._semiMinorAxis,
1010
- rotation: ellipseGeometry._rotation,
1011
- granularity: ellipseGeometry._granularity
1012
- },
1013
- false,
1014
- true
1015
- );
1016
- const positionsFlat = cep.outerPositions;
1017
- const positionsCount = positionsFlat.length / 3;
1018
- const positions = new Array(positionsCount);
1019
- for (let i = 0; i < positionsCount; ++i) {
1020
- positions[i] = Cartesian3_default.fromArray(positionsFlat, i * 3);
1021
- }
1022
- const ellipsoid = ellipseGeometry._ellipsoid;
1023
- const boundingRectangle = ellipseGeometry.rectangle;
1024
- return Geometry_default._textureCoordinateRotationPoints(
1025
- positions,
1026
- stRotation,
1027
- ellipsoid,
1028
- boundingRectangle
1029
- );
1030
- }
1031
- Object.defineProperties(EllipseGeometry.prototype, {
1032
- /**
1033
- * @private
1034
- */
1035
- rectangle: {
1036
- get: function() {
1037
- if (!defined_default(this._rectangle)) {
1038
- this._rectangle = computeRectangle(
1039
- this._center,
1040
- this._semiMajorAxis,
1041
- this._semiMinorAxis,
1042
- this._rotation,
1043
- this._granularity,
1044
- this._ellipsoid
1045
- );
1046
- }
1047
- return this._rectangle;
1048
- }
1049
- },
1050
- /**
1051
- * For remapping texture coordinates when rendering EllipseGeometries as GroundPrimitives.
1052
- * @private
1053
- */
1054
- textureCoordinateRotationPoints: {
1055
- get: function() {
1056
- if (!defined_default(this._textureCoordinateRotationPoints)) {
1057
- this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(this);
1058
- }
1059
- return this._textureCoordinateRotationPoints;
1060
- }
1061
- }
1062
- });
1063
- var EllipseGeometry_default = EllipseGeometry;
1064
-
1065
- export {
1066
- EllipseGeometry_default
1067
- };