@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,445 +1,386 @@
1
- define(['./Transforms-b527bb09', './BoxGeometry-cd550612', './Matrix3-41c58dde', './Color-571a6085', './CylinderGeometry-bc26926d', './defaultValue-fe22d8c0', './EllipsoidGeometry-07e99d2d', './IndexDatatype-2643aa47', './Matrix2-e1298525', './createTaskProcessorWorker', './Check-6ede7e26', './Math-0a2ac845', './combine-d9581036', './RuntimeError-ef395448', './ComponentDatatype-cf1fa08e', './WebGLConstants-0b1ce7ba', './GeometryAttribute-a5b6275b', './GeometryAttributes-ad136444', './GeometryOffsetAttribute-9ad0019c', './VertexFormat-030f11ff', './CylinderGeometryLibrary-7bf291b4'], (function (Transforms, BoxGeometry, Matrix3, Color, CylinderGeometry, defaultValue, EllipsoidGeometry, IndexDatatype, Matrix2, createTaskProcessorWorker, Check, Math$1, combine, RuntimeError, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, VertexFormat, CylinderGeometryLibrary) { 'use strict';
2
-
3
- /**
4
- * Describes a renderable batch of geometry.
5
- *
6
- * @alias Vector3DTileBatch
7
- * @constructor
8
- *
9
- * @param {object} options An object with the following properties:
10
- * @param {number} options.offset The offset of the batch into the indices buffer.
11
- * @param {number} options.count The number of indices in the batch.
12
- * @param {Color} options.color The color of the geometry in the batch.
13
- * @param {number[]} options.batchIds An array where each element is the batch id of the geometry in the batch.
14
- *
15
- * @private
16
- */
17
- function Vector3DTileBatch(options) {
18
- /**
19
- * The offset of the batch into the indices buffer.
20
- * @type {number}
21
- */
22
- this.offset = options.offset;
23
- /**
24
- * The number of indices in the batch.
25
- * @type {number}
26
- */
27
- this.count = options.count;
28
- /**
29
- * The color of the geometry in the batch.
30
- * @type {Color}
31
- */
32
- this.color = options.color;
33
- /**
34
- * An array where each element is the batch id of the geometry in the batch.
35
- * @type {number[]}
36
- */
37
- this.batchIds = options.batchIds;
38
- }
39
-
40
- const scratchCartesian = new Matrix3.Cartesian3();
41
-
42
- const packedBoxLength = Matrix2.Matrix4.packedLength + Matrix3.Cartesian3.packedLength;
43
- const packedCylinderLength = Matrix2.Matrix4.packedLength + 2;
44
- const packedEllipsoidLength = Matrix2.Matrix4.packedLength + Matrix3.Cartesian3.packedLength;
45
- const packedSphereLength = Matrix3.Cartesian3.packedLength + 1;
46
-
47
- const scratchModelMatrixAndBV = {
48
- modelMatrix: new Matrix2.Matrix4(),
49
- boundingVolume: new Transforms.BoundingSphere(),
50
- };
51
-
52
- function boxModelMatrixAndBoundingVolume(boxes, index) {
53
- let boxIndex = index * packedBoxLength;
54
-
55
- const dimensions = Matrix3.Cartesian3.unpack(boxes, boxIndex, scratchCartesian);
56
- boxIndex += Matrix3.Cartesian3.packedLength;
57
-
58
- const boxModelMatrix = Matrix2.Matrix4.unpack(
59
- boxes,
60
- boxIndex,
61
- scratchModelMatrixAndBV.modelMatrix
62
- );
63
- Matrix2.Matrix4.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);
64
-
65
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
66
- Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
67
- boundingVolume.radius = Math.sqrt(3.0);
68
-
69
- return scratchModelMatrixAndBV;
70
- }
71
-
72
- function cylinderModelMatrixAndBoundingVolume(cylinders, index) {
73
- let cylinderIndex = index * packedCylinderLength;
74
-
75
- const cylinderRadius = cylinders[cylinderIndex++];
76
- const length = cylinders[cylinderIndex++];
77
- const scale = Matrix3.Cartesian3.fromElements(
78
- cylinderRadius,
79
- cylinderRadius,
80
- length,
81
- scratchCartesian
82
- );
83
-
84
- const cylinderModelMatrix = Matrix2.Matrix4.unpack(
85
- cylinders,
86
- cylinderIndex,
87
- scratchModelMatrixAndBV.modelMatrix
88
- );
89
- Matrix2.Matrix4.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);
90
-
91
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
92
- Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
93
- boundingVolume.radius = Math.sqrt(2.0);
94
-
95
- return scratchModelMatrixAndBV;
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
+ Color_default
28
+ } from "./chunk-YNZ4DMR7.js";
29
+ import {
30
+ CylinderGeometry_default
31
+ } from "./chunk-MG2TXIO5.js";
32
+ import "./chunk-GLCRFDOB.js";
33
+ import {
34
+ EllipsoidGeometry_default
35
+ } from "./chunk-VN2IHJKM.js";
36
+ import {
37
+ createTaskProcessorWorker_default
38
+ } from "./chunk-UM7FIUQW.js";
39
+ import {
40
+ BoxGeometry_default
41
+ } from "./chunk-44B6FQSJ.js";
42
+ import "./chunk-UMLTOPAE.js";
43
+ import "./chunk-MRCFDEKH.js";
44
+ import {
45
+ IndexDatatype_default
46
+ } from "./chunk-CROU4RHL.js";
47
+ import "./chunk-YLMDWSXO.js";
48
+ import "./chunk-HV67ARO7.js";
49
+ import {
50
+ BoundingSphere_default
51
+ } from "./chunk-V5S5N2IS.js";
52
+ import "./chunk-ULLMQNFQ.js";
53
+ import {
54
+ Matrix4_default
55
+ } from "./chunk-MYDS6HBL.js";
56
+ import "./chunk-CTJCECTX.js";
57
+ import {
58
+ Cartesian3_default
59
+ } from "./chunk-HIDSEUWS.js";
60
+ import "./chunk-4HN3N5SE.js";
61
+ import "./chunk-TXYJOVQK.js";
62
+ import "./chunk-2ZI7FZ3Q.js";
63
+ import "./chunk-GPO47TW4.js";
64
+ import "./chunk-6EHT6GS3.js";
65
+ import {
66
+ defined_default
67
+ } from "./chunk-TXOGSFHZ.js";
68
+
69
+ // packages/engine/Source/Scene/Vector3DTileBatch.js
70
+ function Vector3DTileBatch(options) {
71
+ this.offset = options.offset;
72
+ this.count = options.count;
73
+ this.color = options.color;
74
+ this.batchIds = options.batchIds;
75
+ }
76
+ var Vector3DTileBatch_default = Vector3DTileBatch;
77
+
78
+ // packages/engine/Source/Workers/createVectorTileGeometries.js
79
+ var scratchCartesian = new Cartesian3_default();
80
+ var packedBoxLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
81
+ var packedCylinderLength = Matrix4_default.packedLength + 2;
82
+ var packedEllipsoidLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
83
+ var packedSphereLength = Cartesian3_default.packedLength + 1;
84
+ var scratchModelMatrixAndBV = {
85
+ modelMatrix: new Matrix4_default(),
86
+ boundingVolume: new BoundingSphere_default()
87
+ };
88
+ function boxModelMatrixAndBoundingVolume(boxes, index) {
89
+ let boxIndex = index * packedBoxLength;
90
+ const dimensions = Cartesian3_default.unpack(boxes, boxIndex, scratchCartesian);
91
+ boxIndex += Cartesian3_default.packedLength;
92
+ const boxModelMatrix = Matrix4_default.unpack(
93
+ boxes,
94
+ boxIndex,
95
+ scratchModelMatrixAndBV.modelMatrix
96
+ );
97
+ Matrix4_default.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);
98
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
99
+ Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
100
+ boundingVolume.radius = Math.sqrt(3);
101
+ return scratchModelMatrixAndBV;
102
+ }
103
+ function cylinderModelMatrixAndBoundingVolume(cylinders, index) {
104
+ let cylinderIndex = index * packedCylinderLength;
105
+ const cylinderRadius = cylinders[cylinderIndex++];
106
+ const length = cylinders[cylinderIndex++];
107
+ const scale = Cartesian3_default.fromElements(
108
+ cylinderRadius,
109
+ cylinderRadius,
110
+ length,
111
+ scratchCartesian
112
+ );
113
+ const cylinderModelMatrix = Matrix4_default.unpack(
114
+ cylinders,
115
+ cylinderIndex,
116
+ scratchModelMatrixAndBV.modelMatrix
117
+ );
118
+ Matrix4_default.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);
119
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
120
+ Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
121
+ boundingVolume.radius = Math.sqrt(2);
122
+ return scratchModelMatrixAndBV;
123
+ }
124
+ function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {
125
+ let ellipsoidIndex = index * packedEllipsoidLength;
126
+ const radii = Cartesian3_default.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);
127
+ ellipsoidIndex += Cartesian3_default.packedLength;
128
+ const ellipsoidModelMatrix = Matrix4_default.unpack(
129
+ ellipsoids,
130
+ ellipsoidIndex,
131
+ scratchModelMatrixAndBV.modelMatrix
132
+ );
133
+ Matrix4_default.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);
134
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
135
+ Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
136
+ boundingVolume.radius = 1;
137
+ return scratchModelMatrixAndBV;
138
+ }
139
+ function sphereModelMatrixAndBoundingVolume(spheres, index) {
140
+ let sphereIndex = index * packedSphereLength;
141
+ const sphereRadius = spheres[sphereIndex++];
142
+ const sphereTranslation = Cartesian3_default.unpack(
143
+ spheres,
144
+ sphereIndex,
145
+ scratchCartesian
146
+ );
147
+ const sphereModelMatrix = Matrix4_default.fromTranslation(
148
+ sphereTranslation,
149
+ scratchModelMatrixAndBV.modelMatrix
150
+ );
151
+ Matrix4_default.multiplyByUniformScale(
152
+ sphereModelMatrix,
153
+ sphereRadius,
154
+ sphereModelMatrix
155
+ );
156
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
157
+ Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
158
+ boundingVolume.radius = 1;
159
+ return scratchModelMatrixAndBV;
160
+ }
161
+ var scratchPosition = new Cartesian3_default();
162
+ function createPrimitive(options, primitive, primitiveBatchIds, geometry, getModelMatrixAndBoundingVolume) {
163
+ if (!defined_default(primitive)) {
164
+ return;
96
165
  }
97
-
98
- function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {
99
- let ellipsoidIndex = index * packedEllipsoidLength;
100
-
101
- const radii = Matrix3.Cartesian3.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);
102
- ellipsoidIndex += Matrix3.Cartesian3.packedLength;
103
-
104
- const ellipsoidModelMatrix = Matrix2.Matrix4.unpack(
105
- ellipsoids,
106
- ellipsoidIndex,
107
- scratchModelMatrixAndBV.modelMatrix
166
+ const numberOfPrimitives = primitiveBatchIds.length;
167
+ const geometryPositions = geometry.attributes.position.values;
168
+ const geometryIndices = geometry.indices;
169
+ const positions = options.positions;
170
+ const vertexBatchIds = options.vertexBatchIds;
171
+ const indices = options.indices;
172
+ const batchIds = options.batchIds;
173
+ const batchTableColors = options.batchTableColors;
174
+ const batchedIndices = options.batchedIndices;
175
+ const indexOffsets = options.indexOffsets;
176
+ const indexCounts = options.indexCounts;
177
+ const boundingVolumes = options.boundingVolumes;
178
+ const modelMatrix = options.modelMatrix;
179
+ const center = options.center;
180
+ let positionOffset = options.positionOffset;
181
+ let batchIdIndex = options.batchIdIndex;
182
+ let indexOffset = options.indexOffset;
183
+ const batchedIndicesOffset = options.batchedIndicesOffset;
184
+ for (let i = 0; i < numberOfPrimitives; ++i) {
185
+ const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(
186
+ primitive,
187
+ i
108
188
  );
109
- Matrix2.Matrix4.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);
110
-
111
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
112
- Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
113
- boundingVolume.radius = 1.0;
114
-
115
- return scratchModelMatrixAndBV;
116
- }
117
-
118
- function sphereModelMatrixAndBoundingVolume(spheres, index) {
119
- let sphereIndex = index * packedSphereLength;
120
-
121
- const sphereRadius = spheres[sphereIndex++];
122
-
123
- const sphereTranslation = Matrix3.Cartesian3.unpack(
124
- spheres,
125
- sphereIndex,
126
- scratchCartesian
127
- );
128
- const sphereModelMatrix = Matrix2.Matrix4.fromTranslation(
129
- sphereTranslation,
130
- scratchModelMatrixAndBV.modelMatrix
131
- );
132
- Matrix2.Matrix4.multiplyByUniformScale(
133
- sphereModelMatrix,
134
- sphereRadius,
135
- sphereModelMatrix
136
- );
137
-
138
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
139
- Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
140
- boundingVolume.radius = 1.0;
141
-
142
- return scratchModelMatrixAndBV;
143
- }
144
-
145
- const scratchPosition = new Matrix3.Cartesian3();
146
-
147
- function createPrimitive(
148
- options,
149
- primitive,
150
- primitiveBatchIds,
151
- geometry,
152
- getModelMatrixAndBoundingVolume
153
- ) {
154
- if (!defaultValue.defined(primitive)) {
155
- return;
189
+ const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;
190
+ Matrix4_default.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);
191
+ const batchId = primitiveBatchIds[i];
192
+ const positionsLength = geometryPositions.length;
193
+ for (let j = 0; j < positionsLength; j += 3) {
194
+ const position = Cartesian3_default.unpack(geometryPositions, j, scratchPosition);
195
+ Matrix4_default.multiplyByPoint(primitiveModelMatrix, position, position);
196
+ Cartesian3_default.subtract(position, center, position);
197
+ Cartesian3_default.pack(position, positions, positionOffset * 3 + j);
198
+ vertexBatchIds[batchIdIndex++] = batchId;
156
199
  }
157
-
158
- const numberOfPrimitives = primitiveBatchIds.length;
159
- const geometryPositions = geometry.attributes.position.values;
160
- const geometryIndices = geometry.indices;
161
-
162
- const positions = options.positions;
163
- const vertexBatchIds = options.vertexBatchIds;
164
- const indices = options.indices;
165
-
166
- const batchIds = options.batchIds;
167
- const batchTableColors = options.batchTableColors;
168
- const batchedIndices = options.batchedIndices;
169
- const indexOffsets = options.indexOffsets;
170
- const indexCounts = options.indexCounts;
171
- const boundingVolumes = options.boundingVolumes;
172
-
173
- const modelMatrix = options.modelMatrix;
174
- const center = options.center;
175
-
176
- let positionOffset = options.positionOffset;
177
- let batchIdIndex = options.batchIdIndex;
178
- let indexOffset = options.indexOffset;
179
- const batchedIndicesOffset = options.batchedIndicesOffset;
180
-
181
- for (let i = 0; i < numberOfPrimitives; ++i) {
182
- const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(
183
- primitive,
184
- i
185
- );
186
- const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;
187
- Matrix2.Matrix4.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);
188
-
189
- const batchId = primitiveBatchIds[i];
190
-
191
- const positionsLength = geometryPositions.length;
192
- for (let j = 0; j < positionsLength; j += 3) {
193
- const position = Matrix3.Cartesian3.unpack(geometryPositions, j, scratchPosition);
194
- Matrix2.Matrix4.multiplyByPoint(primitiveModelMatrix, position, position);
195
- Matrix3.Cartesian3.subtract(position, center, position);
196
-
197
- Matrix3.Cartesian3.pack(position, positions, positionOffset * 3 + j);
198
- vertexBatchIds[batchIdIndex++] = batchId;
199
- }
200
-
201
- const indicesLength = geometryIndices.length;
202
- for (let k = 0; k < indicesLength; ++k) {
203
- indices[indexOffset + k] = geometryIndices[k] + positionOffset;
204
- }
205
-
206
- const offset = i + batchedIndicesOffset;
207
- batchedIndices[offset] = new Vector3DTileBatch({
208
- offset: indexOffset,
209
- count: indicesLength,
210
- color: Color.Color.fromRgba(batchTableColors[batchId]),
211
- batchIds: [batchId],
212
- });
213
- batchIds[offset] = batchId;
214
- indexOffsets[offset] = indexOffset;
215
- indexCounts[offset] = indicesLength;
216
- boundingVolumes[offset] = Transforms.BoundingSphere.transform(
217
- primitiveModelMatrixAndBV.boundingVolume,
218
- primitiveModelMatrix
219
- );
220
-
221
- positionOffset += positionsLength / 3;
222
- indexOffset += indicesLength;
200
+ const indicesLength = geometryIndices.length;
201
+ for (let k = 0; k < indicesLength; ++k) {
202
+ indices[indexOffset + k] = geometryIndices[k] + positionOffset;
223
203
  }
224
-
225
- options.positionOffset = positionOffset;
226
- options.batchIdIndex = batchIdIndex;
227
- options.indexOffset = indexOffset;
228
- options.batchedIndicesOffset += numberOfPrimitives;
204
+ const offset = i + batchedIndicesOffset;
205
+ batchedIndices[offset] = new Vector3DTileBatch_default({
206
+ offset: indexOffset,
207
+ count: indicesLength,
208
+ color: Color_default.fromRgba(batchTableColors[batchId]),
209
+ batchIds: [batchId]
210
+ });
211
+ batchIds[offset] = batchId;
212
+ indexOffsets[offset] = indexOffset;
213
+ indexCounts[offset] = indicesLength;
214
+ boundingVolumes[offset] = BoundingSphere_default.transform(
215
+ primitiveModelMatrixAndBV.boundingVolume,
216
+ primitiveModelMatrix
217
+ );
218
+ positionOffset += positionsLength / 3;
219
+ indexOffset += indicesLength;
229
220
  }
230
-
231
- const scratchCenter = new Matrix3.Cartesian3();
232
- const scratchMatrix4 = new Matrix2.Matrix4();
233
-
234
- function unpackBuffer(buffer) {
235
- const packedBuffer = new Float64Array(buffer);
236
-
237
- let offset = 0;
238
- Matrix3.Cartesian3.unpack(packedBuffer, offset, scratchCenter);
239
- offset += Matrix3.Cartesian3.packedLength;
240
-
241
- Matrix2.Matrix4.unpack(packedBuffer, offset, scratchMatrix4);
221
+ options.positionOffset = positionOffset;
222
+ options.batchIdIndex = batchIdIndex;
223
+ options.indexOffset = indexOffset;
224
+ options.batchedIndicesOffset += numberOfPrimitives;
225
+ }
226
+ var scratchCenter = new Cartesian3_default();
227
+ var scratchMatrix4 = new Matrix4_default();
228
+ function unpackBuffer(buffer) {
229
+ const packedBuffer = new Float64Array(buffer);
230
+ let offset = 0;
231
+ Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
232
+ offset += Cartesian3_default.packedLength;
233
+ Matrix4_default.unpack(packedBuffer, offset, scratchMatrix4);
234
+ }
235
+ function packedBatchedIndicesLength(batchedIndices) {
236
+ const length = batchedIndices.length;
237
+ let count = 0;
238
+ for (let i = 0; i < length; ++i) {
239
+ count += Color_default.packedLength + 3 + batchedIndices[i].batchIds.length;
242
240
  }
243
-
244
- function packedBatchedIndicesLength(batchedIndices) {
245
- const length = batchedIndices.length;
246
- let count = 0;
247
- for (let i = 0; i < length; ++i) {
248
- count += Color.Color.packedLength + 3 + batchedIndices[i].batchIds.length;
249
- }
250
- return count;
241
+ return count;
242
+ }
243
+ function packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {
244
+ const numBVs = boundingVolumes.length;
245
+ const length = 1 + 1 + numBVs * BoundingSphere_default.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
246
+ const packedBuffer = new Float64Array(length);
247
+ let offset = 0;
248
+ packedBuffer[offset++] = indicesBytesPerElement;
249
+ packedBuffer[offset++] = numBVs;
250
+ for (let i = 0; i < numBVs; ++i) {
251
+ BoundingSphere_default.pack(boundingVolumes[i], packedBuffer, offset);
252
+ offset += BoundingSphere_default.packedLength;
251
253
  }
252
-
253
- function packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {
254
- const numBVs = boundingVolumes.length;
255
- const length =
256
- 1 +
257
- 1 +
258
- numBVs * Transforms.BoundingSphere.packedLength +
259
- 1 +
260
- packedBatchedIndicesLength(batchedIndices);
261
-
262
- const packedBuffer = new Float64Array(length);
263
-
264
- let offset = 0;
265
- packedBuffer[offset++] = indicesBytesPerElement;
266
- packedBuffer[offset++] = numBVs;
267
-
268
- for (let i = 0; i < numBVs; ++i) {
269
- Transforms.BoundingSphere.pack(boundingVolumes[i], packedBuffer, offset);
270
- offset += Transforms.BoundingSphere.packedLength;
254
+ const indicesLength = batchedIndices.length;
255
+ packedBuffer[offset++] = indicesLength;
256
+ for (let j = 0; j < indicesLength; ++j) {
257
+ const batchedIndex = batchedIndices[j];
258
+ Color_default.pack(batchedIndex.color, packedBuffer, offset);
259
+ offset += Color_default.packedLength;
260
+ packedBuffer[offset++] = batchedIndex.offset;
261
+ packedBuffer[offset++] = batchedIndex.count;
262
+ const batchIds = batchedIndex.batchIds;
263
+ const batchIdsLength = batchIds.length;
264
+ packedBuffer[offset++] = batchIdsLength;
265
+ for (let k = 0; k < batchIdsLength; ++k) {
266
+ packedBuffer[offset++] = batchIds[k];
271
267
  }
272
-
273
- const indicesLength = batchedIndices.length;
274
- packedBuffer[offset++] = indicesLength;
275
-
276
- for (let j = 0; j < indicesLength; ++j) {
277
- const batchedIndex = batchedIndices[j];
278
-
279
- Color.Color.pack(batchedIndex.color, packedBuffer, offset);
280
- offset += Color.Color.packedLength;
281
-
282
- packedBuffer[offset++] = batchedIndex.offset;
283
- packedBuffer[offset++] = batchedIndex.count;
284
-
285
- const batchIds = batchedIndex.batchIds;
286
- const batchIdsLength = batchIds.length;
287
- packedBuffer[offset++] = batchIdsLength;
288
-
289
- for (let k = 0; k < batchIdsLength; ++k) {
290
- packedBuffer[offset++] = batchIds[k];
291
- }
292
- }
293
-
294
- return packedBuffer;
295
- }
296
-
297
- function createVectorTileGeometries(parameters, transferableObjects) {
298
- const boxes = defaultValue.defined(parameters.boxes)
299
- ? new Float32Array(parameters.boxes)
300
- : undefined;
301
- const boxBatchIds = defaultValue.defined(parameters.boxBatchIds)
302
- ? new Uint16Array(parameters.boxBatchIds)
303
- : undefined;
304
- const cylinders = defaultValue.defined(parameters.cylinders)
305
- ? new Float32Array(parameters.cylinders)
306
- : undefined;
307
- const cylinderBatchIds = defaultValue.defined(parameters.cylinderBatchIds)
308
- ? new Uint16Array(parameters.cylinderBatchIds)
309
- : undefined;
310
- const ellipsoids = defaultValue.defined(parameters.ellipsoids)
311
- ? new Float32Array(parameters.ellipsoids)
312
- : undefined;
313
- const ellipsoidBatchIds = defaultValue.defined(parameters.ellipsoidBatchIds)
314
- ? new Uint16Array(parameters.ellipsoidBatchIds)
315
- : undefined;
316
- const spheres = defaultValue.defined(parameters.spheres)
317
- ? new Float32Array(parameters.spheres)
318
- : undefined;
319
- const sphereBatchIds = defaultValue.defined(parameters.sphereBatchIds)
320
- ? new Uint16Array(parameters.sphereBatchIds)
321
- : undefined;
322
-
323
- const numberOfBoxes = defaultValue.defined(boxes) ? boxBatchIds.length : 0;
324
- const numberOfCylinders = defaultValue.defined(cylinders) ? cylinderBatchIds.length : 0;
325
- const numberOfEllipsoids = defaultValue.defined(ellipsoids) ? ellipsoidBatchIds.length : 0;
326
- const numberOfSpheres = defaultValue.defined(spheres) ? sphereBatchIds.length : 0;
327
-
328
- const boxGeometry = BoxGeometry.BoxGeometry.getUnitBox();
329
- const cylinderGeometry = CylinderGeometry.CylinderGeometry.getUnitCylinder();
330
- const ellipsoidGeometry = EllipsoidGeometry.EllipsoidGeometry.getUnitEllipsoid();
331
-
332
- const boxPositions = boxGeometry.attributes.position.values;
333
- const cylinderPositions = cylinderGeometry.attributes.position.values;
334
- const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;
335
-
336
- let numberOfPositions = boxPositions.length * numberOfBoxes;
337
- numberOfPositions += cylinderPositions.length * numberOfCylinders;
338
- numberOfPositions +=
339
- ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);
340
-
341
- const boxIndices = boxGeometry.indices;
342
- const cylinderIndices = cylinderGeometry.indices;
343
- const ellipsoidIndices = ellipsoidGeometry.indices;
344
-
345
- let numberOfIndices = boxIndices.length * numberOfBoxes;
346
- numberOfIndices += cylinderIndices.length * numberOfCylinders;
347
- numberOfIndices +=
348
- ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);
349
-
350
- const positions = new Float32Array(numberOfPositions);
351
- const vertexBatchIds = new Uint16Array(numberOfPositions / 3);
352
- const indices = IndexDatatype.IndexDatatype.createTypedArray(
353
- numberOfPositions / 3,
354
- numberOfIndices
355
- );
356
-
357
- const numberOfGeometries =
358
- numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
359
- const batchIds = new Uint16Array(numberOfGeometries);
360
- const batchedIndices = new Array(numberOfGeometries);
361
- const indexOffsets = new Uint32Array(numberOfGeometries);
362
- const indexCounts = new Uint32Array(numberOfGeometries);
363
- const boundingVolumes = new Array(numberOfGeometries);
364
-
365
- unpackBuffer(parameters.packedBuffer);
366
-
367
- const options = {
368
- batchTableColors: new Uint32Array(parameters.batchTableColors),
369
- positions: positions,
370
- vertexBatchIds: vertexBatchIds,
371
- indices: indices,
372
- batchIds: batchIds,
373
- batchedIndices: batchedIndices,
374
- indexOffsets: indexOffsets,
375
- indexCounts: indexCounts,
376
- boundingVolumes: boundingVolumes,
377
- positionOffset: 0,
378
- batchIdIndex: 0,
379
- indexOffset: 0,
380
- batchedIndicesOffset: 0,
381
- modelMatrix: scratchMatrix4,
382
- center: scratchCenter,
383
- };
384
-
385
- createPrimitive(
386
- options,
387
- boxes,
388
- boxBatchIds,
389
- boxGeometry,
390
- boxModelMatrixAndBoundingVolume
391
- );
392
- createPrimitive(
393
- options,
394
- cylinders,
395
- cylinderBatchIds,
396
- cylinderGeometry,
397
- cylinderModelMatrixAndBoundingVolume
398
- );
399
- createPrimitive(
400
- options,
401
- ellipsoids,
402
- ellipsoidBatchIds,
403
- ellipsoidGeometry,
404
- ellipsoidModelMatrixAndBoundingVolume
405
- );
406
- createPrimitive(
407
- options,
408
- spheres,
409
- sphereBatchIds,
410
- ellipsoidGeometry,
411
- sphereModelMatrixAndBoundingVolume
412
- );
413
-
414
- const packedBuffer = packBuffer(
415
- indices.BYTES_PER_ELEMENT,
416
- batchedIndices,
417
- boundingVolumes
418
- );
419
- transferableObjects.push(
420
- positions.buffer,
421
- vertexBatchIds.buffer,
422
- indices.buffer
423
- );
424
- transferableObjects.push(
425
- batchIds.buffer,
426
- indexOffsets.buffer,
427
- indexCounts.buffer
428
- );
429
- transferableObjects.push(packedBuffer.buffer);
430
-
431
- return {
432
- positions: positions.buffer,
433
- vertexBatchIds: vertexBatchIds.buffer,
434
- indices: indices.buffer,
435
- indexOffsets: indexOffsets.buffer,
436
- indexCounts: indexCounts.buffer,
437
- batchIds: batchIds.buffer,
438
- packedBuffer: packedBuffer.buffer,
439
- };
440
268
  }
441
- var createVectorTileGeometries$1 = createTaskProcessorWorker(createVectorTileGeometries);
442
-
443
- return createVectorTileGeometries$1;
444
-
445
- }));
269
+ return packedBuffer;
270
+ }
271
+ function createVectorTileGeometries(parameters, transferableObjects) {
272
+ const boxes = defined_default(parameters.boxes) ? new Float32Array(parameters.boxes) : void 0;
273
+ const boxBatchIds = defined_default(parameters.boxBatchIds) ? new Uint16Array(parameters.boxBatchIds) : void 0;
274
+ const cylinders = defined_default(parameters.cylinders) ? new Float32Array(parameters.cylinders) : void 0;
275
+ const cylinderBatchIds = defined_default(parameters.cylinderBatchIds) ? new Uint16Array(parameters.cylinderBatchIds) : void 0;
276
+ const ellipsoids = defined_default(parameters.ellipsoids) ? new Float32Array(parameters.ellipsoids) : void 0;
277
+ const ellipsoidBatchIds = defined_default(parameters.ellipsoidBatchIds) ? new Uint16Array(parameters.ellipsoidBatchIds) : void 0;
278
+ const spheres = defined_default(parameters.spheres) ? new Float32Array(parameters.spheres) : void 0;
279
+ const sphereBatchIds = defined_default(parameters.sphereBatchIds) ? new Uint16Array(parameters.sphereBatchIds) : void 0;
280
+ const numberOfBoxes = defined_default(boxes) ? boxBatchIds.length : 0;
281
+ const numberOfCylinders = defined_default(cylinders) ? cylinderBatchIds.length : 0;
282
+ const numberOfEllipsoids = defined_default(ellipsoids) ? ellipsoidBatchIds.length : 0;
283
+ const numberOfSpheres = defined_default(spheres) ? sphereBatchIds.length : 0;
284
+ const boxGeometry = BoxGeometry_default.getUnitBox();
285
+ const cylinderGeometry = CylinderGeometry_default.getUnitCylinder();
286
+ const ellipsoidGeometry = EllipsoidGeometry_default.getUnitEllipsoid();
287
+ const boxPositions = boxGeometry.attributes.position.values;
288
+ const cylinderPositions = cylinderGeometry.attributes.position.values;
289
+ const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;
290
+ let numberOfPositions = boxPositions.length * numberOfBoxes;
291
+ numberOfPositions += cylinderPositions.length * numberOfCylinders;
292
+ numberOfPositions += ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);
293
+ const boxIndices = boxGeometry.indices;
294
+ const cylinderIndices = cylinderGeometry.indices;
295
+ const ellipsoidIndices = ellipsoidGeometry.indices;
296
+ let numberOfIndices = boxIndices.length * numberOfBoxes;
297
+ numberOfIndices += cylinderIndices.length * numberOfCylinders;
298
+ numberOfIndices += ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);
299
+ const positions = new Float32Array(numberOfPositions);
300
+ const vertexBatchIds = new Uint16Array(numberOfPositions / 3);
301
+ const indices = IndexDatatype_default.createTypedArray(
302
+ numberOfPositions / 3,
303
+ numberOfIndices
304
+ );
305
+ const numberOfGeometries = numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
306
+ const batchIds = new Uint16Array(numberOfGeometries);
307
+ const batchedIndices = new Array(numberOfGeometries);
308
+ const indexOffsets = new Uint32Array(numberOfGeometries);
309
+ const indexCounts = new Uint32Array(numberOfGeometries);
310
+ const boundingVolumes = new Array(numberOfGeometries);
311
+ unpackBuffer(parameters.packedBuffer);
312
+ const options = {
313
+ batchTableColors: new Uint32Array(parameters.batchTableColors),
314
+ positions,
315
+ vertexBatchIds,
316
+ indices,
317
+ batchIds,
318
+ batchedIndices,
319
+ indexOffsets,
320
+ indexCounts,
321
+ boundingVolumes,
322
+ positionOffset: 0,
323
+ batchIdIndex: 0,
324
+ indexOffset: 0,
325
+ batchedIndicesOffset: 0,
326
+ modelMatrix: scratchMatrix4,
327
+ center: scratchCenter
328
+ };
329
+ createPrimitive(
330
+ options,
331
+ boxes,
332
+ boxBatchIds,
333
+ boxGeometry,
334
+ boxModelMatrixAndBoundingVolume
335
+ );
336
+ createPrimitive(
337
+ options,
338
+ cylinders,
339
+ cylinderBatchIds,
340
+ cylinderGeometry,
341
+ cylinderModelMatrixAndBoundingVolume
342
+ );
343
+ createPrimitive(
344
+ options,
345
+ ellipsoids,
346
+ ellipsoidBatchIds,
347
+ ellipsoidGeometry,
348
+ ellipsoidModelMatrixAndBoundingVolume
349
+ );
350
+ createPrimitive(
351
+ options,
352
+ spheres,
353
+ sphereBatchIds,
354
+ ellipsoidGeometry,
355
+ sphereModelMatrixAndBoundingVolume
356
+ );
357
+ const packedBuffer = packBuffer(
358
+ indices.BYTES_PER_ELEMENT,
359
+ batchedIndices,
360
+ boundingVolumes
361
+ );
362
+ transferableObjects.push(
363
+ positions.buffer,
364
+ vertexBatchIds.buffer,
365
+ indices.buffer
366
+ );
367
+ transferableObjects.push(
368
+ batchIds.buffer,
369
+ indexOffsets.buffer,
370
+ indexCounts.buffer
371
+ );
372
+ transferableObjects.push(packedBuffer.buffer);
373
+ return {
374
+ positions: positions.buffer,
375
+ vertexBatchIds: vertexBatchIds.buffer,
376
+ indices: indices.buffer,
377
+ indexOffsets: indexOffsets.buffer,
378
+ indexCounts: indexCounts.buffer,
379
+ batchIds: batchIds.buffer,
380
+ packedBuffer: packedBuffer.buffer
381
+ };
382
+ }
383
+ var createVectorTileGeometries_default = createTaskProcessorWorker_default(createVectorTileGeometries);
384
+ export {
385
+ createVectorTileGeometries_default as default
386
+ };