@cesium/engine 3.0.2 → 5.0.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 (246) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
  3. package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
  4. package/Build/Workers/chunk-2U6EBIRX.js +757 -0
  5. package/Build/Workers/chunk-2ZI7FZ3Q.js +58 -0
  6. package/Build/Workers/chunk-3TSHZWOZ.js +1860 -0
  7. package/Build/Workers/chunk-44B6FQSJ.js +684 -0
  8. package/Build/Workers/chunk-4AJR66C5.js +368 -0
  9. package/Build/Workers/chunk-4HN3N5SE.js +501 -0
  10. package/Build/Workers/chunk-4QGPYV3W.js +102 -0
  11. package/Build/Workers/chunk-4RKE4B3G.js +476 -0
  12. package/Build/Workers/chunk-5E3V7Y4R.js +196 -0
  13. package/Build/Workers/chunk-6EHT6GS3.js +163 -0
  14. package/Build/Workers/chunk-6I22NWKQ.js +171 -0
  15. package/Build/Workers/chunk-7N67FBLW.js +1054 -0
  16. package/Build/Workers/chunk-AQQGAFKX.js +124 -0
  17. package/Build/Workers/chunk-CROU4RHL.js +138 -0
  18. package/Build/Workers/chunk-CTJCECTX.js +258 -0
  19. package/Build/Workers/chunk-DWJZFZ67.js +781 -0
  20. package/Build/Workers/chunk-EHJQEARC.js +59 -0
  21. package/Build/Workers/chunk-EVLKHUAE.js +1477 -0
  22. package/Build/Workers/chunk-FOOYJER7.js +834 -0
  23. package/Build/Workers/chunk-GLCRFDOB.js +73 -0
  24. package/Build/Workers/chunk-GPO47TW4.js +39 -0
  25. package/Build/Workers/chunk-H5Q2JKIA.js +1075 -0
  26. package/Build/Workers/chunk-HIDSEUWS.js +2041 -0
  27. package/Build/Workers/chunk-HV67ARO7.js +302 -0
  28. package/Build/Workers/chunk-IC7G4BX2.js +421 -0
  29. package/Build/Workers/chunk-IQN2LMGD.js +55 -0
  30. package/Build/Workers/chunk-J2FHYK2Z.js +55 -0
  31. package/Build/Workers/chunk-K3VEWONC.js +289 -0
  32. package/Build/Workers/chunk-KZFXE35V.js +117 -0
  33. package/Build/Workers/chunk-MG2TXIO5.js +400 -0
  34. package/Build/Workers/chunk-MRCFDEKH.js +138 -0
  35. package/Build/Workers/chunk-MYDS6HBL.js +3273 -0
  36. package/Build/Workers/chunk-OCIX2CQ7.js +305 -0
  37. package/Build/Workers/chunk-P32XMW4I.js +2716 -0
  38. package/Build/Workers/chunk-PEVZYZBQ.js +157 -0
  39. package/Build/Workers/chunk-PMDLIBEQ.js +218 -0
  40. package/Build/Workers/chunk-QDUOGCCO.js +1009 -0
  41. package/Build/Workers/chunk-QUCJGBCK.js +430 -0
  42. package/Build/Workers/chunk-RCI7BSOM.js +452 -0
  43. package/Build/Workers/chunk-SVTSC7FX.js +390 -0
  44. package/Build/Workers/chunk-TXOGSFHZ.js +77 -0
  45. package/Build/Workers/chunk-TXYJOVQK.js +629 -0
  46. package/Build/Workers/chunk-UFIT5XDI.js +1258 -0
  47. package/Build/Workers/chunk-ULLMQNFQ.js +73 -0
  48. package/Build/Workers/chunk-UM7FIUQW.js +101 -0
  49. package/Build/Workers/{package.js → chunk-UMLTOPAE.js} +13 -2
  50. package/Build/Workers/chunk-V5S5N2IS.js +8644 -0
  51. package/Build/Workers/chunk-VN2IHJKM.js +513 -0
  52. package/Build/Workers/chunk-VWSD2XV5.js +669 -0
  53. package/Build/Workers/chunk-X2KIWBTW.js +100 -0
  54. package/Build/Workers/chunk-Y24CDOJC.js +353 -0
  55. package/Build/Workers/chunk-YLMDWSXO.js +44 -0
  56. package/Build/Workers/chunk-YNZ4DMR7.js +634 -0
  57. package/Build/Workers/chunk-Z2MP3UBE.js +236 -0
  58. package/Build/Workers/combineGeometry.js +65 -15
  59. package/Build/Workers/createBoxGeometry.js +55 -10
  60. package/Build/Workers/createBoxOutlineGeometry.js +231 -310
  61. package/Build/Workers/createCircleGeometry.js +185 -202
  62. package/Build/Workers/createCircleOutlineGeometry.js +141 -155
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  65. package/Build/Workers/createCorridorGeometry.js +1163 -1307
  66. package/Build/Workers/createCorridorOutlineGeometry.js +534 -569
  67. package/Build/Workers/createCylinderGeometry.js +57 -10
  68. package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
  69. package/Build/Workers/createEllipseGeometry.js +68 -12
  70. package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
  71. package/Build/Workers/createEllipsoidGeometry.js +56 -10
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
  73. package/Build/Workers/createFrustumGeometry.js +55 -10
  74. package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
  75. package/Build/Workers/createGeometry.js +143 -48
  76. package/Build/Workers/createGroundPolylineGeometry.js +1484 -2012
  77. package/Build/Workers/createPlaneGeometry.js +216 -243
  78. package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
  79. package/Build/Workers/createPolygonGeometry.js +1437 -1314
  80. package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
  81. package/Build/Workers/createPolylineGeometry.js +471 -547
  82. package/Build/Workers/createPolylineVolumeGeometry.js +354 -384
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -295
  84. package/Build/Workers/createRectangleGeometry.js +1128 -1331
  85. package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
  86. package/Build/Workers/createSimplePolylineGeometry.js +381 -440
  87. package/Build/Workers/createSphereGeometry.js +112 -118
  88. package/Build/Workers/createSphereOutlineGeometry.js +112 -121
  89. package/Build/Workers/createTaskProcessorWorker.js +32 -127
  90. package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
  91. package/Build/Workers/createVectorTileGeometries.js +377 -436
  92. package/Build/Workers/createVectorTilePoints.js +110 -77
  93. package/Build/Workers/createVectorTilePolygons.js +369 -391
  94. package/Build/Workers/createVectorTilePolylines.js +252 -244
  95. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  96. package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
  97. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
  98. package/Build/Workers/createWallGeometry.js +459 -593
  99. package/Build/Workers/createWallOutlineGeometry.js +324 -419
  100. package/Build/Workers/decodeDraco.js +327 -347
  101. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  102. package/Build/Workers/decodeI3S.js +765 -970
  103. package/Build/Workers/transcodeKTX2.js +3351 -1473
  104. package/Build/Workers/transferTypedArrayTest.js +3 -4
  105. package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  106. package/LICENSE.md +0 -12
  107. package/Source/Core/CesiumTerrainProvider.js +1 -2
  108. package/Source/Core/Credit.js +7 -1
  109. package/Source/Core/FeatureDetection.js +9 -0
  110. package/Source/Core/GoogleMaps.js +1 -2
  111. package/Source/Core/Ion.js +1 -2
  112. package/Source/Core/KTX2Transcoder.js +7 -3
  113. package/Source/Core/PolygonGeometry.js +340 -27
  114. package/Source/Core/PolygonGeometryLibrary.js +302 -1
  115. package/Source/Core/Stereographic.js +247 -0
  116. package/Source/Core/TaskProcessor.js +185 -168
  117. package/Source/Core/Transforms.js +2 -2
  118. package/Source/Core/buildModuleUrl.js +6 -5
  119. package/Source/Core/sampleTerrain.js +43 -10
  120. package/Source/Core/sampleTerrainMostDetailed.js +27 -3
  121. package/Source/Scene/ArcGisMapService.js +1 -2
  122. package/Source/Scene/Billboard.js +7 -0
  123. package/Source/Scene/Cesium3DTilePass.js +1 -1
  124. package/Source/Scene/Cesium3DTileset.js +38 -81
  125. package/Source/Scene/CreditDisplay.js +2 -2
  126. package/Source/Scene/DracoLoader.js +26 -3
  127. package/Source/Scene/I3SDataProvider.js +0 -27
  128. package/Source/Scene/I3SDecoder.js +127 -0
  129. package/Source/Scene/I3SNode.js +32 -110
  130. package/Source/Scene/Implicit3DTileContent.js +13 -0
  131. package/Source/Scene/ImplicitTileset.js +5 -0
  132. package/Source/Scene/LabelCollection.js +3 -1
  133. package/Source/Scene/Model/I3dmLoader.js +5 -1
  134. package/Source/Scene/Model/Model.js +20 -23
  135. package/Source/Scene/OpenStreetMapImageryProvider.js +4 -1
  136. package/Source/Scene/PostProcessStageLibrary.js +3 -3
  137. package/Source/Scene/PrimitiveCollection.js +39 -0
  138. package/Source/Scene/Scene.js +3 -0
  139. package/Source/Scene/SingleTileImageryProvider.js +4 -2
  140. package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
  141. package/Source/Widget/CesiumWidget.js +2 -1
  142. package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
  143. package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
  144. package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
  145. package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
  146. package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
  147. package/Source/Workers/transferTypedArrayTest.js +0 -6
  148. package/index.d.ts +69 -35
  149. package/index.js +189 -187
  150. package/package.json +2 -1
  151. package/Build/Workers/ArcType-2d9abbbc.js +0 -37
  152. package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
  153. package/Build/Workers/AxisAlignedBoundingBox-a03420b1.js +0 -258
  154. package/Build/Workers/BoundingRectangle-32fa8a4a.js +0 -369
  155. package/Build/Workers/BoxGeometry-cd550612.js +0 -884
  156. package/Build/Workers/Check-6ede7e26.js +0 -290
  157. package/Build/Workers/Color-571a6085.js +0 -2262
  158. package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  159. package/Build/Workers/CoplanarPolygonGeometryLibrary-488b1a9f.js +0 -132
  160. package/Build/Workers/CorridorGeometryLibrary-fc4ff147.js +0 -498
  161. package/Build/Workers/CylinderGeometry-bc26926d.js +0 -467
  162. package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  163. package/Build/Workers/EllipseGeometry-89533a10.js +0 -1304
  164. package/Build/Workers/EllipseGeometryLibrary-b0d7df17.js +0 -366
  165. package/Build/Workers/EllipseOutlineGeometry-63ff7a87.js +0 -443
  166. package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  167. package/Build/Workers/EllipsoidGeometry-07e99d2d.js +0 -637
  168. package/Build/Workers/EllipsoidOutlineGeometry-ba5c7ee2.js +0 -454
  169. package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  170. package/Build/Workers/EllipsoidTangentPlane-65d41b3e.js +0 -373
  171. package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
  172. package/Build/Workers/FrustumGeometry-4a7589ed.js +0 -2540
  173. package/Build/Workers/GeometryAttribute-a5b6275b.js +0 -619
  174. package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
  175. package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
  176. package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  177. package/Build/Workers/GeometryPipeline-fa9e6ffc.js +0 -3690
  178. package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
  179. package/Build/Workers/IntersectionTests-feace3da.js +0 -1836
  180. package/Build/Workers/Math-0a2ac845.js +0 -1340
  181. package/Build/Workers/Matrix2-e1298525.js +0 -7086
  182. package/Build/Workers/Matrix3-41c58dde.js +0 -4283
  183. package/Build/Workers/OrientedBoundingBox-6b94d955.js +0 -1259
  184. package/Build/Workers/Plane-4c3d403b.js +0 -309
  185. package/Build/Workers/PolygonGeometryLibrary-4ffc457d.js +0 -1074
  186. package/Build/Workers/PolygonPipeline-d5e66350.js +0 -1344
  187. package/Build/Workers/PolylinePipeline-83410f0c.js +0 -573
  188. package/Build/Workers/PolylineVolumeGeometryLibrary-290e7aec.js +0 -781
  189. package/Build/Workers/PrimitivePipeline-6081d138.js +0 -966
  190. package/Build/Workers/RectangleGeometryLibrary-986710d8.js +0 -280
  191. package/Build/Workers/RuntimeError-ef395448.js +0 -68
  192. package/Build/Workers/TerrainEncoding-528e1d68.js +0 -1227
  193. package/Build/Workers/Transforms-b527bb09.js +0 -14714
  194. package/Build/Workers/VertexFormat-030f11ff.js +0 -312
  195. package/Build/Workers/WallGeometryLibrary-faf583f8.js +0 -211
  196. package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  197. package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  198. package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  199. package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
  200. package/Build/Workers/combine-d9581036.js +0 -82
  201. package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
  202. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  203. package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
  204. package/Source/Workers/package.json +0 -1
  205. /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
  206. /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
  207. /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
  208. /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
  209. /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
  210. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
  211. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
  212. /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
  213. /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
  214. /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
  215. /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
  216. /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
  217. /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
  218. /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
  219. /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
  220. /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
  221. /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
  222. /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
  223. /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
  224. /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
  225. /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
  226. /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
  227. /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
  228. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
  229. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
  230. /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
  231. /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
  232. /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
  233. /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
  234. /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
  235. /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
  236. /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
  237. /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
  238. /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
  239. /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
  240. /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
  241. /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
  242. /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
  243. /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
  244. /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
  245. /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
  246. /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
@@ -1,120 +1,175 @@
1
- define(['./arrayRemoveDuplicates-d2061e85', './Transforms-b527bb09', './Matrix3-41c58dde', './Check-6ede7e26', './ComponentDatatype-cf1fa08e', './PolylineVolumeGeometryLibrary-290e7aec', './CorridorGeometryLibrary-fc4ff147', './defaultValue-fe22d8c0', './GeometryAttribute-a5b6275b', './GeometryAttributes-ad136444', './GeometryOffsetAttribute-9ad0019c', './IndexDatatype-2643aa47', './Math-0a2ac845', './PolygonPipeline-d5e66350', './Matrix2-e1298525', './RuntimeError-ef395448', './combine-d9581036', './WebGLConstants-0b1ce7ba', './EllipsoidTangentPlane-65d41b3e', './AxisAlignedBoundingBox-a03420b1', './IntersectionTests-feace3da', './Plane-4c3d403b', './PolylinePipeline-83410f0c', './EllipsoidGeodesic-5b3623dc', './EllipsoidRhumbLine-ef872433'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, PolylineVolumeGeometryLibrary, CorridorGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, Matrix2, RuntimeError, combine$1, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
2
-
3
- const cartesian1 = new Matrix3.Cartesian3();
4
- const cartesian2 = new Matrix3.Cartesian3();
5
- const cartesian3 = new Matrix3.Cartesian3();
6
-
7
- function scaleToSurface(positions, ellipsoid) {
8
- for (let i = 0; i < positions.length; i++) {
9
- positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
10
- }
11
- return positions;
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.110
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
+ CorridorGeometryLibrary_default
28
+ } from "./chunk-4RKE4B3G.js";
29
+ import {
30
+ CornerType_default
31
+ } from "./chunk-VWSD2XV5.js";
32
+ import "./chunk-J2FHYK2Z.js";
33
+ import "./chunk-IC7G4BX2.js";
34
+ import "./chunk-Y24CDOJC.js";
35
+ import {
36
+ GeometryOffsetAttribute_default
37
+ } from "./chunk-UMLTOPAE.js";
38
+ import "./chunk-K3VEWONC.js";
39
+ import "./chunk-PEVZYZBQ.js";
40
+ import {
41
+ PolygonPipeline_default
42
+ } from "./chunk-QDUOGCCO.js";
43
+ import {
44
+ arrayRemoveDuplicates_default
45
+ } from "./chunk-X2KIWBTW.js";
46
+ import "./chunk-RCI7BSOM.js";
47
+ import "./chunk-UFIT5XDI.js";
48
+ import "./chunk-6I22NWKQ.js";
49
+ import {
50
+ IndexDatatype_default
51
+ } from "./chunk-CROU4RHL.js";
52
+ import {
53
+ GeometryAttributes_default
54
+ } from "./chunk-YLMDWSXO.js";
55
+ import {
56
+ GeometryAttribute_default,
57
+ Geometry_default,
58
+ PrimitiveType_default
59
+ } from "./chunk-HV67ARO7.js";
60
+ import {
61
+ BoundingSphere_default
62
+ } from "./chunk-V5S5N2IS.js";
63
+ import "./chunk-ULLMQNFQ.js";
64
+ import "./chunk-MYDS6HBL.js";
65
+ import {
66
+ ComponentDatatype_default
67
+ } from "./chunk-CTJCECTX.js";
68
+ import {
69
+ Cartesian3_default,
70
+ Ellipsoid_default
71
+ } from "./chunk-HIDSEUWS.js";
72
+ import {
73
+ Math_default
74
+ } from "./chunk-4HN3N5SE.js";
75
+ import "./chunk-TXYJOVQK.js";
76
+ import "./chunk-2ZI7FZ3Q.js";
77
+ import {
78
+ defaultValue_default
79
+ } from "./chunk-GPO47TW4.js";
80
+ import {
81
+ Check_default
82
+ } from "./chunk-6EHT6GS3.js";
83
+ import {
84
+ defined_default
85
+ } from "./chunk-TXOGSFHZ.js";
86
+
87
+ // packages/engine/Source/Core/CorridorOutlineGeometry.js
88
+ var cartesian1 = new Cartesian3_default();
89
+ var cartesian2 = new Cartesian3_default();
90
+ var cartesian3 = new Cartesian3_default();
91
+ function scaleToSurface(positions, ellipsoid) {
92
+ for (let i = 0; i < positions.length; i++) {
93
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
12
94
  }
13
-
14
- function combine(computedPositions, cornerType) {
15
- const wallIndices = [];
16
- const positions = computedPositions.positions;
17
- const corners = computedPositions.corners;
18
- const endPositions = computedPositions.endPositions;
19
- const attributes = new GeometryAttributes.GeometryAttributes();
20
- let corner;
21
- let leftCount = 0;
22
- let rightCount = 0;
23
- let i;
24
- let indicesLength = 0;
25
- let length;
26
- for (i = 0; i < positions.length; i += 2) {
27
- length = positions[i].length - 3;
28
- leftCount += length; //subtracting 3 to account for duplicate points at corners
29
- indicesLength += (length / 3) * 4;
30
- rightCount += positions[i + 1].length - 3;
31
- }
32
- leftCount += 3; //add back count for end positions
33
- rightCount += 3;
34
- for (i = 0; i < corners.length; i++) {
35
- corner = corners[i];
36
- const leftSide = corners[i].leftPositions;
37
- if (defaultValue.defined(leftSide)) {
38
- length = leftSide.length;
39
- leftCount += length;
40
- indicesLength += (length / 3) * 2;
41
- } else {
42
- length = corners[i].rightPositions.length;
43
- rightCount += length;
44
- indicesLength += (length / 3) * 2;
45
- }
46
- }
47
-
48
- const addEndPositions = defaultValue.defined(endPositions);
49
- let endPositionLength;
50
- if (addEndPositions) {
51
- endPositionLength = endPositions[0].length - 3;
52
- leftCount += endPositionLength;
53
- rightCount += endPositionLength;
54
- endPositionLength /= 3;
55
- indicesLength += endPositionLength * 4;
56
- }
57
- const size = leftCount + rightCount;
58
- const finalPositions = new Float64Array(size);
59
- let front = 0;
60
- let back = size - 1;
61
- let UL, LL, UR, LR;
62
- let rightPos, leftPos;
63
- const halfLength = endPositionLength / 2;
64
-
65
- const indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength + 4);
66
- let index = 0;
67
-
68
- indices[index++] = front / 3;
69
- indices[index++] = (back - 2) / 3;
70
- if (addEndPositions) {
71
- // add rounded end
72
- wallIndices.push(front / 3);
73
- leftPos = cartesian1;
74
- rightPos = cartesian2;
75
- const firstEndPositions = endPositions[0];
76
- for (i = 0; i < halfLength; i++) {
77
- leftPos = Matrix3.Cartesian3.fromArray(
78
- firstEndPositions,
79
- (halfLength - 1 - i) * 3,
80
- leftPos
81
- );
82
- rightPos = Matrix3.Cartesian3.fromArray(
83
- firstEndPositions,
84
- (halfLength + i) * 3,
85
- rightPos
86
- );
87
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
88
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
89
- finalPositions,
90
- leftPos,
91
- undefined,
92
- back
93
- );
94
-
95
- LL = front / 3;
96
- LR = LL + 1;
97
- UL = (back - 2) / 3;
98
- UR = UL - 1;
99
- indices[index++] = UL;
100
- indices[index++] = UR;
101
- indices[index++] = LL;
102
- indices[index++] = LR;
103
-
104
- front += 3;
105
- back -= 3;
106
- }
95
+ return positions;
96
+ }
97
+ function combine(computedPositions, cornerType) {
98
+ const wallIndices = [];
99
+ const positions = computedPositions.positions;
100
+ const corners = computedPositions.corners;
101
+ const endPositions = computedPositions.endPositions;
102
+ const attributes = new GeometryAttributes_default();
103
+ let corner;
104
+ let leftCount = 0;
105
+ let rightCount = 0;
106
+ let i;
107
+ let indicesLength = 0;
108
+ let length;
109
+ for (i = 0; i < positions.length; i += 2) {
110
+ length = positions[i].length - 3;
111
+ leftCount += length;
112
+ indicesLength += length / 3 * 4;
113
+ rightCount += positions[i + 1].length - 3;
114
+ }
115
+ leftCount += 3;
116
+ rightCount += 3;
117
+ for (i = 0; i < corners.length; i++) {
118
+ corner = corners[i];
119
+ const leftSide = corners[i].leftPositions;
120
+ if (defined_default(leftSide)) {
121
+ length = leftSide.length;
122
+ leftCount += length;
123
+ indicesLength += length / 3 * 2;
124
+ } else {
125
+ length = corners[i].rightPositions.length;
126
+ rightCount += length;
127
+ indicesLength += length / 3 * 2;
107
128
  }
108
-
109
- let posIndex = 0;
110
- let rightEdge = positions[posIndex++]; //add first two edges
111
- let leftEdge = positions[posIndex++];
112
- finalPositions.set(rightEdge, front);
113
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
114
-
115
- length = leftEdge.length - 3;
116
- wallIndices.push(front / 3, (back - 2) / 3);
117
- for (i = 0; i < length; i += 3) {
129
+ }
130
+ const addEndPositions = defined_default(endPositions);
131
+ let endPositionLength;
132
+ if (addEndPositions) {
133
+ endPositionLength = endPositions[0].length - 3;
134
+ leftCount += endPositionLength;
135
+ rightCount += endPositionLength;
136
+ endPositionLength /= 3;
137
+ indicesLength += endPositionLength * 4;
138
+ }
139
+ const size = leftCount + rightCount;
140
+ const finalPositions = new Float64Array(size);
141
+ let front = 0;
142
+ let back = size - 1;
143
+ let UL, LL, UR, LR;
144
+ let rightPos, leftPos;
145
+ const halfLength = endPositionLength / 2;
146
+ const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength + 4);
147
+ let index = 0;
148
+ indices[index++] = front / 3;
149
+ indices[index++] = (back - 2) / 3;
150
+ if (addEndPositions) {
151
+ wallIndices.push(front / 3);
152
+ leftPos = cartesian1;
153
+ rightPos = cartesian2;
154
+ const firstEndPositions = endPositions[0];
155
+ for (i = 0; i < halfLength; i++) {
156
+ leftPos = Cartesian3_default.fromArray(
157
+ firstEndPositions,
158
+ (halfLength - 1 - i) * 3,
159
+ leftPos
160
+ );
161
+ rightPos = Cartesian3_default.fromArray(
162
+ firstEndPositions,
163
+ (halfLength + i) * 3,
164
+ rightPos
165
+ );
166
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
167
+ CorridorGeometryLibrary_default.addAttribute(
168
+ finalPositions,
169
+ leftPos,
170
+ void 0,
171
+ back
172
+ );
118
173
  LL = front / 3;
119
174
  LR = LL + 1;
120
175
  UL = (back - 2) / 3;
@@ -123,481 +178,391 @@ define(['./arrayRemoveDuplicates-d2061e85', './Transforms-b527bb09', './Matrix3-
123
178
  indices[index++] = UR;
124
179
  indices[index++] = LL;
125
180
  indices[index++] = LR;
126
-
127
181
  front += 3;
128
182
  back -= 3;
129
183
  }
130
-
131
- for (i = 0; i < corners.length; i++) {
132
- let j;
133
- corner = corners[i];
134
- const l = corner.leftPositions;
135
- const r = corner.rightPositions;
136
- let start;
137
- let outsidePoint = cartesian3;
138
- if (defaultValue.defined(l)) {
139
- back -= 3;
140
- start = UR;
141
- wallIndices.push(LR);
142
- for (j = 0; j < l.length / 3; j++) {
143
- outsidePoint = Matrix3.Cartesian3.fromArray(l, j * 3, outsidePoint);
144
- indices[index++] = start - j - 1;
145
- indices[index++] = start - j;
146
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
147
- finalPositions,
148
- outsidePoint,
149
- undefined,
150
- back
151
- );
152
- back -= 3;
153
- }
154
- wallIndices.push(start - Math.floor(l.length / 6));
155
- if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
156
- wallIndices.push((back - 2) / 3 + 1);
157
- }
158
- front += 3;
159
- } else {
160
- front += 3;
161
- start = LR;
162
- wallIndices.push(UR);
163
- for (j = 0; j < r.length / 3; j++) {
164
- outsidePoint = Matrix3.Cartesian3.fromArray(r, j * 3, outsidePoint);
165
- indices[index++] = start + j;
166
- indices[index++] = start + j + 1;
167
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
168
- finalPositions,
169
- outsidePoint,
170
- front
171
- );
172
- front += 3;
173
- }
174
- wallIndices.push(start + Math.floor(r.length / 6));
175
- if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
176
- wallIndices.push(front / 3 - 1);
177
- }
184
+ }
185
+ let posIndex = 0;
186
+ let rightEdge = positions[posIndex++];
187
+ let leftEdge = positions[posIndex++];
188
+ finalPositions.set(rightEdge, front);
189
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
190
+ length = leftEdge.length - 3;
191
+ wallIndices.push(front / 3, (back - 2) / 3);
192
+ for (i = 0; i < length; i += 3) {
193
+ LL = front / 3;
194
+ LR = LL + 1;
195
+ UL = (back - 2) / 3;
196
+ UR = UL - 1;
197
+ indices[index++] = UL;
198
+ indices[index++] = UR;
199
+ indices[index++] = LL;
200
+ indices[index++] = LR;
201
+ front += 3;
202
+ back -= 3;
203
+ }
204
+ for (i = 0; i < corners.length; i++) {
205
+ let j;
206
+ corner = corners[i];
207
+ const l = corner.leftPositions;
208
+ const r = corner.rightPositions;
209
+ let start;
210
+ let outsidePoint = cartesian3;
211
+ if (defined_default(l)) {
212
+ back -= 3;
213
+ start = UR;
214
+ wallIndices.push(LR);
215
+ for (j = 0; j < l.length / 3; j++) {
216
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
217
+ indices[index++] = start - j - 1;
218
+ indices[index++] = start - j;
219
+ CorridorGeometryLibrary_default.addAttribute(
220
+ finalPositions,
221
+ outsidePoint,
222
+ void 0,
223
+ back
224
+ );
178
225
  back -= 3;
179
226
  }
180
- rightEdge = positions[posIndex++];
181
- leftEdge = positions[posIndex++];
182
- rightEdge.splice(0, 3); //remove duplicate points added by corner
183
- leftEdge.splice(leftEdge.length - 3, 3);
184
- finalPositions.set(rightEdge, front);
185
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
186
- length = leftEdge.length - 3;
187
-
188
- for (j = 0; j < leftEdge.length; j += 3) {
189
- LR = front / 3;
190
- LL = LR - 1;
191
- UR = (back - 2) / 3;
192
- UL = UR + 1;
193
- indices[index++] = UL;
194
- indices[index++] = UR;
195
- indices[index++] = LL;
196
- indices[index++] = LR;
197
- front += 3;
198
- back -= 3;
227
+ wallIndices.push(start - Math.floor(l.length / 6));
228
+ if (cornerType === CornerType_default.BEVELED) {
229
+ wallIndices.push((back - 2) / 3 + 1);
199
230
  }
200
- front -= 3;
201
- back += 3;
202
- wallIndices.push(front / 3, (back - 2) / 3);
203
- }
204
-
205
- if (addEndPositions) {
206
- // add rounded end
207
231
  front += 3;
208
- back -= 3;
209
- leftPos = cartesian1;
210
- rightPos = cartesian2;
211
- const lastEndPositions = endPositions[1];
212
- for (i = 0; i < halfLength; i++) {
213
- leftPos = Matrix3.Cartesian3.fromArray(
214
- lastEndPositions,
215
- (endPositionLength - i - 1) * 3,
216
- leftPos
217
- );
218
- rightPos = Matrix3.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
219
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
232
+ } else {
233
+ front += 3;
234
+ start = LR;
235
+ wallIndices.push(UR);
236
+ for (j = 0; j < r.length / 3; j++) {
237
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
238
+ indices[index++] = start + j;
239
+ indices[index++] = start + j + 1;
240
+ CorridorGeometryLibrary_default.addAttribute(
220
241
  finalPositions,
221
- leftPos,
222
- undefined,
223
- back
242
+ outsidePoint,
243
+ front
224
244
  );
225
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
226
-
227
- LR = front / 3;
228
- LL = LR - 1;
229
- UR = (back - 2) / 3;
230
- UL = UR + 1;
231
- indices[index++] = UL;
232
- indices[index++] = UR;
233
- indices[index++] = LL;
234
- indices[index++] = LR;
235
-
236
245
  front += 3;
237
- back -= 3;
238
246
  }
239
-
240
- wallIndices.push(front / 3);
241
- } else {
242
- wallIndices.push(front / 3, (back - 2) / 3);
243
- }
244
- indices[index++] = front / 3;
245
- indices[index++] = (back - 2) / 3;
246
-
247
- attributes.position = new GeometryAttribute.GeometryAttribute({
248
- componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
249
- componentsPerAttribute: 3,
250
- values: finalPositions,
251
- });
252
-
253
- return {
254
- attributes: attributes,
255
- indices: indices,
256
- wallIndices: wallIndices,
257
- };
258
- }
259
-
260
- function computePositionsExtruded(params) {
261
- const ellipsoid = params.ellipsoid;
262
- const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
263
- const attr = combine(computedPositions, params.cornerType);
264
- const wallIndices = attr.wallIndices;
265
- const height = params.height;
266
- const extrudedHeight = params.extrudedHeight;
267
- const attributes = attr.attributes;
268
- const indices = attr.indices;
269
- let positions = attributes.position.values;
270
- let length = positions.length;
271
- let extrudedPositions = new Float64Array(length);
272
- extrudedPositions.set(positions);
273
- const newPositions = new Float64Array(length * 2);
274
-
275
- positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
276
- positions,
277
- height,
278
- ellipsoid
279
- );
280
- extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
281
- extrudedPositions,
282
- extrudedHeight,
283
- ellipsoid
284
- );
285
- newPositions.set(positions);
286
- newPositions.set(extrudedPositions, length);
287
- attributes.position.values = newPositions;
288
-
289
- length /= 3;
290
- if (defaultValue.defined(params.offsetAttribute)) {
291
- let applyOffset = new Uint8Array(length * 2);
292
- if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
293
- applyOffset = applyOffset.fill(1, 0, length);
294
- } else {
295
- const applyOffsetValue =
296
- params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
297
- applyOffset = applyOffset.fill(applyOffsetValue);
247
+ wallIndices.push(start + Math.floor(r.length / 6));
248
+ if (cornerType === CornerType_default.BEVELED) {
249
+ wallIndices.push(front / 3 - 1);
298
250
  }
299
-
300
- attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
301
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
302
- componentsPerAttribute: 1,
303
- values: applyOffset,
304
- });
305
- }
306
-
307
- let i;
308
- const iLength = indices.length;
309
- const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
310
- newPositions.length / 3,
311
- (iLength + wallIndices.length) * 2
312
- );
313
- newIndices.set(indices);
314
- let index = iLength;
315
- for (i = 0; i < iLength; i += 2) {
316
- // bottom indices
317
- const v0 = indices[i];
318
- const v1 = indices[i + 1];
319
- newIndices[index++] = v0 + length;
320
- newIndices[index++] = v1 + length;
251
+ back -= 3;
321
252
  }
322
-
323
- let UL, LL;
324
- for (i = 0; i < wallIndices.length; i++) {
325
- //wall indices
326
- UL = wallIndices[i];
327
- LL = UL + length;
328
- newIndices[index++] = UL;
329
- newIndices[index++] = LL;
253
+ rightEdge = positions[posIndex++];
254
+ leftEdge = positions[posIndex++];
255
+ rightEdge.splice(0, 3);
256
+ leftEdge.splice(leftEdge.length - 3, 3);
257
+ finalPositions.set(rightEdge, front);
258
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
259
+ length = leftEdge.length - 3;
260
+ for (j = 0; j < leftEdge.length; j += 3) {
261
+ LR = front / 3;
262
+ LL = LR - 1;
263
+ UR = (back - 2) / 3;
264
+ UL = UR + 1;
265
+ indices[index++] = UL;
266
+ indices[index++] = UR;
267
+ indices[index++] = LL;
268
+ indices[index++] = LR;
269
+ front += 3;
270
+ back -= 3;
330
271
  }
331
-
332
- return {
333
- attributes: attributes,
334
- indices: newIndices,
335
- };
336
- }
337
-
338
- /**
339
- * A description of a corridor outline.
340
- *
341
- * @alias CorridorOutlineGeometry
342
- * @constructor
343
- *
344
- * @param {object} options Object with the following properties:
345
- * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.
346
- * @param {number} options.width The distance between the edges of the corridor outline.
347
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
348
- * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
349
- * @param {number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.
350
- * @param {number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.
351
- * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
352
- *
353
- * @see CorridorOutlineGeometry.createGeometry
354
- *
355
- * @example
356
- * const corridor = new Cesium.CorridorOutlineGeometry({
357
- * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
358
- * width : 100000
359
- * });
360
- */
361
- function CorridorOutlineGeometry(options) {
362
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
363
- const positions = options.positions;
364
- const width = options.width;
365
-
366
- //>>includeStart('debug', pragmas.debug);
367
- Check.Check.typeOf.object("options.positions", positions);
368
- Check.Check.typeOf.number("options.width", width);
369
- //>>includeEnd('debug');
370
-
371
- const height = defaultValue.defaultValue(options.height, 0.0);
372
- const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
373
-
374
- this._positions = positions;
375
- this._ellipsoid = Matrix3.Ellipsoid.clone(
376
- defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
377
- );
378
- this._width = width;
379
- this._height = Math.max(height, extrudedHeight);
380
- this._extrudedHeight = Math.min(height, extrudedHeight);
381
- this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
382
- this._granularity = defaultValue.defaultValue(
383
- options.granularity,
384
- Math$1.CesiumMath.RADIANS_PER_DEGREE
385
- );
386
- this._offsetAttribute = options.offsetAttribute;
387
- this._workerName = "createCorridorOutlineGeometry";
388
-
389
- /**
390
- * The number of elements used to pack the object into an array.
391
- * @type {number}
392
- */
393
- this.packedLength =
394
- 1 + positions.length * Matrix3.Cartesian3.packedLength + Matrix3.Ellipsoid.packedLength + 6;
272
+ front -= 3;
273
+ back += 3;
274
+ wallIndices.push(front / 3, (back - 2) / 3);
395
275
  }
396
-
397
- /**
398
- * Stores the provided instance into the provided array.
399
- *
400
- * @param {CorridorOutlineGeometry} value The value to pack.
401
- * @param {number[]} array The array to pack into.
402
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
403
- *
404
- * @returns {number[]} The array that was packed into
405
- */
406
- CorridorOutlineGeometry.pack = function (value, array, startingIndex) {
407
- //>>includeStart('debug', pragmas.debug);
408
- Check.Check.typeOf.object("value", value);
409
- Check.Check.typeOf.object("array", array);
410
- //>>includeEnd('debug');
411
-
412
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
413
-
414
- const positions = value._positions;
415
- const length = positions.length;
416
- array[startingIndex++] = length;
417
-
418
- for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
419
- Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
420
- }
421
-
422
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
423
- startingIndex += Matrix3.Ellipsoid.packedLength;
424
-
425
- array[startingIndex++] = value._width;
426
- array[startingIndex++] = value._height;
427
- array[startingIndex++] = value._extrudedHeight;
428
- array[startingIndex++] = value._cornerType;
429
- array[startingIndex++] = value._granularity;
430
- array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
431
-
432
- return array;
433
- };
434
-
435
- const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
436
- const scratchOptions = {
437
- positions: undefined,
438
- ellipsoid: scratchEllipsoid,
439
- width: undefined,
440
- height: undefined,
441
- extrudedHeight: undefined,
442
- cornerType: undefined,
443
- granularity: undefined,
444
- offsetAttribute: undefined,
445
- };
446
-
447
- /**
448
- * Retrieves an instance from a packed array.
449
- *
450
- * @param {number[]} array The packed array.
451
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
452
- * @param {CorridorOutlineGeometry} [result] The object into which to store the result.
453
- * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
454
- */
455
- CorridorOutlineGeometry.unpack = function (array, startingIndex, result) {
456
- //>>includeStart('debug', pragmas.debug);
457
- Check.Check.typeOf.object("array", array);
458
- //>>includeEnd('debug');
459
-
460
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
461
-
462
- const length = array[startingIndex++];
463
- const positions = new Array(length);
464
-
465
- for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
466
- positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
467
- }
468
-
469
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
470
- startingIndex += Matrix3.Ellipsoid.packedLength;
471
-
472
- const width = array[startingIndex++];
473
- const height = array[startingIndex++];
474
- const extrudedHeight = array[startingIndex++];
475
- const cornerType = array[startingIndex++];
476
- const granularity = array[startingIndex++];
477
- const offsetAttribute = array[startingIndex];
478
-
479
- if (!defaultValue.defined(result)) {
480
- scratchOptions.positions = positions;
481
- scratchOptions.width = width;
482
- scratchOptions.height = height;
483
- scratchOptions.extrudedHeight = extrudedHeight;
484
- scratchOptions.cornerType = cornerType;
485
- scratchOptions.granularity = granularity;
486
- scratchOptions.offsetAttribute =
487
- offsetAttribute === -1 ? undefined : offsetAttribute;
488
- return new CorridorOutlineGeometry(scratchOptions);
276
+ if (addEndPositions) {
277
+ front += 3;
278
+ back -= 3;
279
+ leftPos = cartesian1;
280
+ rightPos = cartesian2;
281
+ const lastEndPositions = endPositions[1];
282
+ for (i = 0; i < halfLength; i++) {
283
+ leftPos = Cartesian3_default.fromArray(
284
+ lastEndPositions,
285
+ (endPositionLength - i - 1) * 3,
286
+ leftPos
287
+ );
288
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
289
+ CorridorGeometryLibrary_default.addAttribute(
290
+ finalPositions,
291
+ leftPos,
292
+ void 0,
293
+ back
294
+ );
295
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
296
+ LR = front / 3;
297
+ LL = LR - 1;
298
+ UR = (back - 2) / 3;
299
+ UL = UR + 1;
300
+ indices[index++] = UL;
301
+ indices[index++] = UR;
302
+ indices[index++] = LL;
303
+ indices[index++] = LR;
304
+ front += 3;
305
+ back -= 3;
489
306
  }
490
-
491
- result._positions = positions;
492
- result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
493
- result._width = width;
494
- result._height = height;
495
- result._extrudedHeight = extrudedHeight;
496
- result._cornerType = cornerType;
497
- result._granularity = granularity;
498
- result._offsetAttribute =
499
- offsetAttribute === -1 ? undefined : offsetAttribute;
500
-
501
- return result;
307
+ wallIndices.push(front / 3);
308
+ } else {
309
+ wallIndices.push(front / 3, (back - 2) / 3);
310
+ }
311
+ indices[index++] = front / 3;
312
+ indices[index++] = (back - 2) / 3;
313
+ attributes.position = new GeometryAttribute_default({
314
+ componentDatatype: ComponentDatatype_default.DOUBLE,
315
+ componentsPerAttribute: 3,
316
+ values: finalPositions
317
+ });
318
+ return {
319
+ attributes,
320
+ indices,
321
+ wallIndices
502
322
  };
503
-
504
- /**
505
- * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
506
- *
507
- * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.
508
- * @returns {Geometry|undefined} The computed vertices and indices.
509
- */
510
- CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) {
511
- let positions = corridorOutlineGeometry._positions;
512
- const width = corridorOutlineGeometry._width;
513
- const ellipsoid = corridorOutlineGeometry._ellipsoid;
514
-
515
- positions = scaleToSurface(positions, ellipsoid);
516
- const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
517
- positions,
518
- Matrix3.Cartesian3.equalsEpsilon
519
- );
520
-
521
- if (cleanPositions.length < 2 || width <= 0) {
522
- return;
523
- }
524
-
525
- const height = corridorOutlineGeometry._height;
526
- const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
527
- const extrude = !Math$1.CesiumMath.equalsEpsilon(
528
- height,
529
- extrudedHeight,
530
- 0,
531
- Math$1.CesiumMath.EPSILON2
532
- );
533
-
534
- const params = {
535
- ellipsoid: ellipsoid,
536
- positions: cleanPositions,
537
- width: width,
538
- cornerType: corridorOutlineGeometry._cornerType,
539
- granularity: corridorOutlineGeometry._granularity,
540
- saveAttributes: false,
541
- };
542
- let attr;
543
- if (extrude) {
544
- params.height = height;
545
- params.extrudedHeight = extrudedHeight;
546
- params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
547
- attr = computePositionsExtruded(params);
323
+ }
324
+ function computePositionsExtruded(params) {
325
+ const ellipsoid = params.ellipsoid;
326
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
327
+ const attr = combine(computedPositions, params.cornerType);
328
+ const wallIndices = attr.wallIndices;
329
+ const height = params.height;
330
+ const extrudedHeight = params.extrudedHeight;
331
+ const attributes = attr.attributes;
332
+ const indices = attr.indices;
333
+ let positions = attributes.position.values;
334
+ let length = positions.length;
335
+ let extrudedPositions = new Float64Array(length);
336
+ extrudedPositions.set(positions);
337
+ const newPositions = new Float64Array(length * 2);
338
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
339
+ positions,
340
+ height,
341
+ ellipsoid
342
+ );
343
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
344
+ extrudedPositions,
345
+ extrudedHeight,
346
+ ellipsoid
347
+ );
348
+ newPositions.set(positions);
349
+ newPositions.set(extrudedPositions, length);
350
+ attributes.position.values = newPositions;
351
+ length /= 3;
352
+ if (defined_default(params.offsetAttribute)) {
353
+ let applyOffset = new Uint8Array(length * 2);
354
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
355
+ applyOffset = applyOffset.fill(1, 0, length);
548
356
  } else {
549
- const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
550
- attr = combine(computedPositions, params.cornerType);
551
- attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
552
- attr.attributes.position.values,
553
- height,
554
- ellipsoid
555
- );
556
-
557
- if (defaultValue.defined(corridorOutlineGeometry._offsetAttribute)) {
558
- const length = attr.attributes.position.values.length;
559
- const offsetValue =
560
- corridorOutlineGeometry._offsetAttribute ===
561
- GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
562
- ? 0
563
- : 1;
564
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
565
- attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
566
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
567
- componentsPerAttribute: 1,
568
- values: applyOffset,
569
- });
570
- }
357
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
358
+ applyOffset = applyOffset.fill(applyOffsetValue);
571
359
  }
572
- const attributes = attr.attributes;
573
- const boundingSphere = Transforms.BoundingSphere.fromVertices(
574
- attributes.position.values,
575
- undefined,
576
- 3
577
- );
578
-
579
- return new GeometryAttribute.Geometry({
580
- attributes: attributes,
581
- indices: attr.indices,
582
- primitiveType: GeometryAttribute.PrimitiveType.LINES,
583
- boundingSphere: boundingSphere,
584
- offsetAttribute: corridorOutlineGeometry._offsetAttribute,
360
+ attributes.applyOffset = new GeometryAttribute_default({
361
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
362
+ componentsPerAttribute: 1,
363
+ values: applyOffset
585
364
  });
365
+ }
366
+ let i;
367
+ const iLength = indices.length;
368
+ const newIndices = IndexDatatype_default.createTypedArray(
369
+ newPositions.length / 3,
370
+ (iLength + wallIndices.length) * 2
371
+ );
372
+ newIndices.set(indices);
373
+ let index = iLength;
374
+ for (i = 0; i < iLength; i += 2) {
375
+ const v0 = indices[i];
376
+ const v1 = indices[i + 1];
377
+ newIndices[index++] = v0 + length;
378
+ newIndices[index++] = v1 + length;
379
+ }
380
+ let UL, LL;
381
+ for (i = 0; i < wallIndices.length; i++) {
382
+ UL = wallIndices[i];
383
+ LL = UL + length;
384
+ newIndices[index++] = UL;
385
+ newIndices[index++] = LL;
386
+ }
387
+ return {
388
+ attributes,
389
+ indices: newIndices
586
390
  };
587
-
588
- function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
589
- if (defaultValue.defined(offset)) {
590
- corridorOutlineGeometry = CorridorOutlineGeometry.unpack(
591
- corridorOutlineGeometry,
592
- offset
593
- );
391
+ }
392
+ function CorridorOutlineGeometry(options) {
393
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
394
+ const positions = options.positions;
395
+ const width = options.width;
396
+ Check_default.typeOf.object("options.positions", positions);
397
+ Check_default.typeOf.number("options.width", width);
398
+ const height = defaultValue_default(options.height, 0);
399
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
400
+ this._positions = positions;
401
+ this._ellipsoid = Ellipsoid_default.clone(
402
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
403
+ );
404
+ this._width = width;
405
+ this._height = Math.max(height, extrudedHeight);
406
+ this._extrudedHeight = Math.min(height, extrudedHeight);
407
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
408
+ this._granularity = defaultValue_default(
409
+ options.granularity,
410
+ Math_default.RADIANS_PER_DEGREE
411
+ );
412
+ this._offsetAttribute = options.offsetAttribute;
413
+ this._workerName = "createCorridorOutlineGeometry";
414
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 6;
415
+ }
416
+ CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
417
+ Check_default.typeOf.object("value", value);
418
+ Check_default.typeOf.object("array", array);
419
+ startingIndex = defaultValue_default(startingIndex, 0);
420
+ const positions = value._positions;
421
+ const length = positions.length;
422
+ array[startingIndex++] = length;
423
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
424
+ Cartesian3_default.pack(positions[i], array, startingIndex);
425
+ }
426
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
427
+ startingIndex += Ellipsoid_default.packedLength;
428
+ array[startingIndex++] = value._width;
429
+ array[startingIndex++] = value._height;
430
+ array[startingIndex++] = value._extrudedHeight;
431
+ array[startingIndex++] = value._cornerType;
432
+ array[startingIndex++] = value._granularity;
433
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
434
+ return array;
435
+ };
436
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
437
+ var scratchOptions = {
438
+ positions: void 0,
439
+ ellipsoid: scratchEllipsoid,
440
+ width: void 0,
441
+ height: void 0,
442
+ extrudedHeight: void 0,
443
+ cornerType: void 0,
444
+ granularity: void 0,
445
+ offsetAttribute: void 0
446
+ };
447
+ CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
448
+ Check_default.typeOf.object("array", array);
449
+ startingIndex = defaultValue_default(startingIndex, 0);
450
+ const length = array[startingIndex++];
451
+ const positions = new Array(length);
452
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
453
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
454
+ }
455
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
456
+ startingIndex += Ellipsoid_default.packedLength;
457
+ const width = array[startingIndex++];
458
+ const height = array[startingIndex++];
459
+ const extrudedHeight = array[startingIndex++];
460
+ const cornerType = array[startingIndex++];
461
+ const granularity = array[startingIndex++];
462
+ const offsetAttribute = array[startingIndex];
463
+ if (!defined_default(result)) {
464
+ scratchOptions.positions = positions;
465
+ scratchOptions.width = width;
466
+ scratchOptions.height = height;
467
+ scratchOptions.extrudedHeight = extrudedHeight;
468
+ scratchOptions.cornerType = cornerType;
469
+ scratchOptions.granularity = granularity;
470
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
471
+ return new CorridorOutlineGeometry(scratchOptions);
472
+ }
473
+ result._positions = positions;
474
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
475
+ result._width = width;
476
+ result._height = height;
477
+ result._extrudedHeight = extrudedHeight;
478
+ result._cornerType = cornerType;
479
+ result._granularity = granularity;
480
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
481
+ return result;
482
+ };
483
+ CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
484
+ let positions = corridorOutlineGeometry._positions;
485
+ const width = corridorOutlineGeometry._width;
486
+ const ellipsoid = corridorOutlineGeometry._ellipsoid;
487
+ positions = scaleToSurface(positions, ellipsoid);
488
+ const cleanPositions = arrayRemoveDuplicates_default(
489
+ positions,
490
+ Cartesian3_default.equalsEpsilon
491
+ );
492
+ if (cleanPositions.length < 2 || width <= 0) {
493
+ return;
494
+ }
495
+ const height = corridorOutlineGeometry._height;
496
+ const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
497
+ const extrude = !Math_default.equalsEpsilon(
498
+ height,
499
+ extrudedHeight,
500
+ 0,
501
+ Math_default.EPSILON2
502
+ );
503
+ const params = {
504
+ ellipsoid,
505
+ positions: cleanPositions,
506
+ width,
507
+ cornerType: corridorOutlineGeometry._cornerType,
508
+ granularity: corridorOutlineGeometry._granularity,
509
+ saveAttributes: false
510
+ };
511
+ let attr;
512
+ if (extrude) {
513
+ params.height = height;
514
+ params.extrudedHeight = extrudedHeight;
515
+ params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
516
+ attr = computePositionsExtruded(params);
517
+ } else {
518
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
519
+ attr = combine(computedPositions, params.cornerType);
520
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
521
+ attr.attributes.position.values,
522
+ height,
523
+ ellipsoid
524
+ );
525
+ if (defined_default(corridorOutlineGeometry._offsetAttribute)) {
526
+ const length = attr.attributes.position.values.length;
527
+ const offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
528
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
529
+ attr.attributes.applyOffset = new GeometryAttribute_default({
530
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
531
+ componentsPerAttribute: 1,
532
+ values: applyOffset
533
+ });
594
534
  }
595
- corridorOutlineGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
596
- corridorOutlineGeometry._ellipsoid
535
+ }
536
+ const attributes = attr.attributes;
537
+ const boundingSphere = BoundingSphere_default.fromVertices(
538
+ attributes.position.values,
539
+ void 0,
540
+ 3
541
+ );
542
+ return new Geometry_default({
543
+ attributes,
544
+ indices: attr.indices,
545
+ primitiveType: PrimitiveType_default.LINES,
546
+ boundingSphere,
547
+ offsetAttribute: corridorOutlineGeometry._offsetAttribute
548
+ });
549
+ };
550
+ var CorridorOutlineGeometry_default = CorridorOutlineGeometry;
551
+
552
+ // packages/engine/Source/Workers/createCorridorOutlineGeometry.js
553
+ function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
554
+ if (defined_default(offset)) {
555
+ corridorOutlineGeometry = CorridorOutlineGeometry_default.unpack(
556
+ corridorOutlineGeometry,
557
+ offset
597
558
  );
598
- return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry);
599
559
  }
600
-
601
- return createCorridorOutlineGeometry;
602
-
603
- }));
560
+ corridorOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
561
+ corridorOutlineGeometry._ellipsoid
562
+ );
563
+ return CorridorOutlineGeometry_default.createGeometry(corridorOutlineGeometry);
564
+ }
565
+ var createCorridorOutlineGeometry_default = createCorridorOutlineGeometry;
566
+ export {
567
+ createCorridorOutlineGeometry_default as default
568
+ };