@gmgis/gm-sdk 1.12.5 → 2.0.2

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 (159) hide show
  1. package/dist/dist/index.js +1848 -0
  2. package/dist/gm.min.js +16983 -16483
  3. package/dist/index.js +1436 -1434
  4. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  5. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  8. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  9. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  10. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  11. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  12. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  13. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  14. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  15. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  16. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  17. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  18. package/dist/resources/Workers/{chunk-I2ITFFPX.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-PRGYLLJT.js → chunk-ARG42DC4.js} +2 -31
  21. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  22. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  23. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  24. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  25. package/dist/resources/Workers/{chunk-DI5NGJUP.js → chunk-D6AA5QVT.js} +2 -20
  26. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  27. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  28. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  29. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  30. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  31. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  32. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  33. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  34. package/dist/resources/Workers/{chunk-7JO7GPJN.js → chunk-GBYLG25F.js} +2 -15
  35. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  36. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  37. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  38. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  39. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  40. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  41. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  42. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  43. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  44. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  45. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  46. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  47. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  48. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  49. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  50. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  51. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  52. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  53. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  54. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  55. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  56. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  57. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  58. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  59. package/dist/resources/Workers/{chunk-6CHGCNMW.js → chunk-WZDE3RYP.js} +4 -34
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -40
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -32
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -209
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -175
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -121
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -481
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -199
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1237
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -542
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -34
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -205
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -45
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -38
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -33
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -35
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -32
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -210
  78. package/dist/resources/Workers/createGeometry.js +2 -144
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1582
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -198
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -98
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1381
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -509
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -470
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -354
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -251
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1246
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -453
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -374
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -92
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -92
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -466
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -361
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -359
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -236
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -539
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2252
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -729
  101. package/dist/resources/Workers/createWallGeometry.js +2 -464
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -312
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2642
  105. package/dist/resources/Workers/decodeI3S.js +2 -1319
  106. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  108. package/dist/resources/Workers/transcodeKTX2.js +29 -3360
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -793
  111. package/package.json +74 -74
  112. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  113. package/dist/resources/Workers/chunk-26GA3JAM.js +0 -139
  114. package/dist/resources/Workers/chunk-27HUZ7SA.js +0 -305
  115. package/dist/resources/Workers/chunk-2ZGOQXYU.js +0 -171
  116. package/dist/resources/Workers/chunk-3Q2L65QU.js +0 -1258
  117. package/dist/resources/Workers/chunk-472HQ3EH.js +0 -100
  118. package/dist/resources/Workers/chunk-5ODQSF26.js +0 -101
  119. package/dist/resources/Workers/chunk-5OOFQLKF.js +0 -634
  120. package/dist/resources/Workers/chunk-5PTXS2GO.js +0 -10390
  121. package/dist/resources/Workers/chunk-76BYBWHP.js +0 -122
  122. package/dist/resources/Workers/chunk-7BMOHCPM.js +0 -390
  123. package/dist/resources/Workers/chunk-7KTQP4VB.js +0 -59
  124. package/dist/resources/Workers/chunk-7O373FFS.js +0 -665
  125. package/dist/resources/Workers/chunk-AD63PIY6.js +0 -163
  126. package/dist/resources/Workers/chunk-BHQJ2NT7.js +0 -353
  127. package/dist/resources/Workers/chunk-C6YYBQXW.js +0 -102
  128. package/dist/resources/Workers/chunk-CKY7HOHV.js +0 -287
  129. package/dist/resources/Workers/chunk-DHYHSFFJ.js +0 -73
  130. package/dist/resources/Workers/chunk-E27BLMDD.js +0 -115
  131. package/dist/resources/Workers/chunk-E63IIM5T.js +0 -75
  132. package/dist/resources/Workers/chunk-E6V6SQZW.js +0 -456
  133. package/dist/resources/Workers/chunk-EJZTDTUH.js +0 -138
  134. package/dist/resources/Workers/chunk-FDOV2LBJ.js +0 -220
  135. package/dist/resources/Workers/chunk-FIGIZHAQ.js +0 -684
  136. package/dist/resources/Workers/chunk-GESF4OXQ.js +0 -1800
  137. package/dist/resources/Workers/chunk-GGZJN2TI.js +0 -2717
  138. package/dist/resources/Workers/chunk-GNBFYG7F.js +0 -1481
  139. package/dist/resources/Workers/chunk-GWCFU2SA.js +0 -300
  140. package/dist/resources/Workers/chunk-IBLIYJZR.js +0 -196
  141. package/dist/resources/Workers/chunk-JW4FOI6M.js +0 -476
  142. package/dist/resources/Workers/chunk-K4GQUNB5.js +0 -262
  143. package/dist/resources/Workers/chunk-M3GMB5OP.js +0 -834
  144. package/dist/resources/Workers/chunk-MXIZJAPH.js +0 -629
  145. package/dist/resources/Workers/chunk-N5KJGGCM.js +0 -1073
  146. package/dist/resources/Workers/chunk-NGPPMXRM.js +0 -435
  147. package/dist/resources/Workers/chunk-O3E4OAOE.js +0 -511
  148. package/dist/resources/Workers/chunk-PGRPDNHG.js +0 -1048
  149. package/dist/resources/Workers/chunk-S6MRMMQU.js +0 -157
  150. package/dist/resources/Workers/chunk-SMDOP47J.js +0 -945
  151. package/dist/resources/Workers/chunk-TGONEMZO.js +0 -421
  152. package/dist/resources/Workers/chunk-TKVT5GQM.js +0 -781
  153. package/dist/resources/Workers/chunk-U72QNFOJ.js +0 -758
  154. package/dist/resources/Workers/chunk-VJZB3WAV.js +0 -963
  155. package/dist/resources/Workers/chunk-VU2MNO7L.js +0 -239
  156. package/dist/resources/Workers/chunk-XY4BATBS.js +0 -500
  157. package/dist/resources/Workers/chunk-YFXQECWV.js +0 -2857
  158. package/dist/resources/Workers/chunk-YSGTGQQO.js +0 -398
  159. package/dist/resources/Workers/chunk-YZ733KKS.js +0 -368
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,363 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- Color_default
28
- } from "./chunk-5OOFQLKF.js";
29
- import {
30
- CylinderGeometry_default
31
- } from "./chunk-YSGTGQQO.js";
32
- import "./chunk-DHYHSFFJ.js";
33
- import {
34
- EllipsoidGeometry_default
35
- } from "./chunk-O3E4OAOE.js";
36
- import {
37
- createTaskProcessorWorker_default
38
- } from "./chunk-5ODQSF26.js";
39
- import {
40
- BoxGeometry_default
41
- } from "./chunk-FIGIZHAQ.js";
42
- import "./chunk-I2ITFFPX.js";
43
- import "./chunk-EJZTDTUH.js";
44
- import {
45
- IndexDatatype_default
46
- } from "./chunk-26GA3JAM.js";
47
- import "./chunk-DI5NGJUP.js";
48
- import "./chunk-GWCFU2SA.js";
49
- import {
50
- BoundingSphere_default
51
- } from "./chunk-VJZB3WAV.js";
52
- import {
53
- Matrix4_default
54
- } from "./chunk-5PTXS2GO.js";
55
- import "./chunk-K4GQUNB5.js";
56
- import {
57
- Cartesian3_default
58
- } from "./chunk-YFXQECWV.js";
59
- import "./chunk-XY4BATBS.js";
60
- import "./chunk-MXIZJAPH.js";
61
- import "./chunk-6CHGCNMW.js";
62
- import "./chunk-7JO7GPJN.js";
63
- import "./chunk-AD63PIY6.js";
64
- import {
65
- defined_default
66
- } from "./chunk-E63IIM5T.js";
67
-
68
- // packages/engine/Source/Scene/Vector3DTileBatch.js
69
- function Vector3DTileBatch(options) {
70
- this.offset = options.offset;
71
- this.count = options.count;
72
- this.color = options.color;
73
- this.batchIds = options.batchIds;
74
- }
75
- var Vector3DTileBatch_default = Vector3DTileBatch;
76
-
77
- // packages/engine/Source/Workers/createVectorTileGeometries.js
78
- var scratchCartesian = new Cartesian3_default();
79
- var packedBoxLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
80
- var packedCylinderLength = Matrix4_default.packedLength + 2;
81
- var packedEllipsoidLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
82
- var packedSphereLength = Cartesian3_default.packedLength + 1;
83
- var scratchModelMatrixAndBV = {
84
- modelMatrix: new Matrix4_default(),
85
- boundingVolume: new BoundingSphere_default()
86
- };
87
- function boxModelMatrixAndBoundingVolume(boxes, index) {
88
- let boxIndex = index * packedBoxLength;
89
- const dimensions = Cartesian3_default.unpack(boxes, boxIndex, scratchCartesian);
90
- boxIndex += Cartesian3_default.packedLength;
91
- const boxModelMatrix = Matrix4_default.unpack(
92
- boxes,
93
- boxIndex,
94
- scratchModelMatrixAndBV.modelMatrix
95
- );
96
- Matrix4_default.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);
97
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
98
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
99
- boundingVolume.radius = Math.sqrt(3);
100
- return scratchModelMatrixAndBV;
101
- }
102
- function cylinderModelMatrixAndBoundingVolume(cylinders, index) {
103
- let cylinderIndex = index * packedCylinderLength;
104
- const cylinderRadius = cylinders[cylinderIndex++];
105
- const length = cylinders[cylinderIndex++];
106
- const scale = Cartesian3_default.fromElements(
107
- cylinderRadius,
108
- cylinderRadius,
109
- length,
110
- scratchCartesian
111
- );
112
- const cylinderModelMatrix = Matrix4_default.unpack(
113
- cylinders,
114
- cylinderIndex,
115
- scratchModelMatrixAndBV.modelMatrix
116
- );
117
- Matrix4_default.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);
118
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
119
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
120
- boundingVolume.radius = Math.sqrt(2);
121
- return scratchModelMatrixAndBV;
122
- }
123
- function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {
124
- let ellipsoidIndex = index * packedEllipsoidLength;
125
- const radii = Cartesian3_default.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);
126
- ellipsoidIndex += Cartesian3_default.packedLength;
127
- const ellipsoidModelMatrix = Matrix4_default.unpack(
128
- ellipsoids,
129
- ellipsoidIndex,
130
- scratchModelMatrixAndBV.modelMatrix
131
- );
132
- Matrix4_default.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);
133
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
134
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
135
- boundingVolume.radius = 1;
136
- return scratchModelMatrixAndBV;
137
- }
138
- function sphereModelMatrixAndBoundingVolume(spheres, index) {
139
- let sphereIndex = index * packedSphereLength;
140
- const sphereRadius = spheres[sphereIndex++];
141
- const sphereTranslation = Cartesian3_default.unpack(
142
- spheres,
143
- sphereIndex,
144
- scratchCartesian
145
- );
146
- const sphereModelMatrix = Matrix4_default.fromTranslation(
147
- sphereTranslation,
148
- scratchModelMatrixAndBV.modelMatrix
149
- );
150
- Matrix4_default.multiplyByUniformScale(
151
- sphereModelMatrix,
152
- sphereRadius,
153
- sphereModelMatrix
154
- );
155
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
156
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
157
- boundingVolume.radius = 1;
158
- return scratchModelMatrixAndBV;
159
- }
160
- var scratchPosition = new Cartesian3_default();
161
- function createPrimitive(options, primitive, primitiveBatchIds, geometry, getModelMatrixAndBoundingVolume) {
162
- if (!defined_default(primitive)) {
163
- return;
164
- }
165
- const numberOfPrimitives = primitiveBatchIds.length;
166
- const geometryPositions = geometry.attributes.position.values;
167
- const geometryIndices = geometry.indices;
168
- const positions = options.positions;
169
- const vertexBatchIds = options.vertexBatchIds;
170
- const indices = options.indices;
171
- const batchIds = options.batchIds;
172
- const batchTableColors = options.batchTableColors;
173
- const batchedIndices = options.batchedIndices;
174
- const indexOffsets = options.indexOffsets;
175
- const indexCounts = options.indexCounts;
176
- const boundingVolumes = options.boundingVolumes;
177
- const modelMatrix = options.modelMatrix;
178
- const center = options.center;
179
- let positionOffset = options.positionOffset;
180
- let batchIdIndex = options.batchIdIndex;
181
- let indexOffset = options.indexOffset;
182
- const batchedIndicesOffset = options.batchedIndicesOffset;
183
- for (let i = 0; i < numberOfPrimitives; ++i) {
184
- const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(
185
- primitive,
186
- i
187
- );
188
- const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;
189
- Matrix4_default.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);
190
- const batchId = primitiveBatchIds[i];
191
- const positionsLength = geometryPositions.length;
192
- for (let j = 0; j < positionsLength; j += 3) {
193
- const position = Cartesian3_default.unpack(geometryPositions, j, scratchPosition);
194
- Matrix4_default.multiplyByPoint(primitiveModelMatrix, position, position);
195
- Cartesian3_default.subtract(position, center, position);
196
- Cartesian3_default.pack(position, positions, positionOffset * 3 + j);
197
- vertexBatchIds[batchIdIndex++] = batchId;
198
- }
199
- const indicesLength = geometryIndices.length;
200
- for (let k = 0; k < indicesLength; ++k) {
201
- indices[indexOffset + k] = geometryIndices[k] + positionOffset;
202
- }
203
- const offset = i + batchedIndicesOffset;
204
- batchedIndices[offset] = new Vector3DTileBatch_default({
205
- offset: indexOffset,
206
- count: indicesLength,
207
- color: Color_default.fromRgba(batchTableColors[batchId]),
208
- batchIds: [batchId]
209
- });
210
- batchIds[offset] = batchId;
211
- indexOffsets[offset] = indexOffset;
212
- indexCounts[offset] = indicesLength;
213
- boundingVolumes[offset] = BoundingSphere_default.transform(
214
- primitiveModelMatrixAndBV.boundingVolume,
215
- primitiveModelMatrix
216
- );
217
- positionOffset += positionsLength / 3;
218
- indexOffset += indicesLength;
219
- }
220
- options.positionOffset = positionOffset;
221
- options.batchIdIndex = batchIdIndex;
222
- options.indexOffset = indexOffset;
223
- options.batchedIndicesOffset += numberOfPrimitives;
224
- }
225
- var scratchCenter = new Cartesian3_default();
226
- var scratchMatrix4 = new Matrix4_default();
227
- function unpackBuffer(buffer) {
228
- const packedBuffer = new Float64Array(buffer);
229
- let offset = 0;
230
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
231
- offset += Cartesian3_default.packedLength;
232
- Matrix4_default.unpack(packedBuffer, offset, scratchMatrix4);
233
- }
234
- function packedBatchedIndicesLength(batchedIndices) {
235
- const length = batchedIndices.length;
236
- let count = 0;
237
- for (let i = 0; i < length; ++i) {
238
- count += Color_default.packedLength + 3 + batchedIndices[i].batchIds.length;
239
- }
240
- return count;
241
- }
242
- function packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {
243
- const numBVs = boundingVolumes.length;
244
- const length = 1 + 1 + numBVs * BoundingSphere_default.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
245
- const packedBuffer = new Float64Array(length);
246
- let offset = 0;
247
- packedBuffer[offset++] = indicesBytesPerElement;
248
- packedBuffer[offset++] = numBVs;
249
- for (let i = 0; i < numBVs; ++i) {
250
- BoundingSphere_default.pack(boundingVolumes[i], packedBuffer, offset);
251
- offset += BoundingSphere_default.packedLength;
252
- }
253
- const indicesLength = batchedIndices.length;
254
- packedBuffer[offset++] = indicesLength;
255
- for (let j = 0; j < indicesLength; ++j) {
256
- const batchedIndex = batchedIndices[j];
257
- Color_default.pack(batchedIndex.color, packedBuffer, offset);
258
- offset += Color_default.packedLength;
259
- packedBuffer[offset++] = batchedIndex.offset;
260
- packedBuffer[offset++] = batchedIndex.count;
261
- const batchIds = batchedIndex.batchIds;
262
- const batchIdsLength = batchIds.length;
263
- packedBuffer[offset++] = batchIdsLength;
264
- for (let k = 0; k < batchIdsLength; ++k) {
265
- packedBuffer[offset++] = batchIds[k];
266
- }
267
- }
268
- return packedBuffer;
269
- }
270
- function createVectorTileGeometries(parameters, transferableObjects) {
271
- const boxes = defined_default(parameters.boxes) ? new Float32Array(parameters.boxes) : void 0;
272
- const boxBatchIds = defined_default(parameters.boxBatchIds) ? new Uint16Array(parameters.boxBatchIds) : void 0;
273
- const cylinders = defined_default(parameters.cylinders) ? new Float32Array(parameters.cylinders) : void 0;
274
- const cylinderBatchIds = defined_default(parameters.cylinderBatchIds) ? new Uint16Array(parameters.cylinderBatchIds) : void 0;
275
- const ellipsoids = defined_default(parameters.ellipsoids) ? new Float32Array(parameters.ellipsoids) : void 0;
276
- const ellipsoidBatchIds = defined_default(parameters.ellipsoidBatchIds) ? new Uint16Array(parameters.ellipsoidBatchIds) : void 0;
277
- const spheres = defined_default(parameters.spheres) ? new Float32Array(parameters.spheres) : void 0;
278
- const sphereBatchIds = defined_default(parameters.sphereBatchIds) ? new Uint16Array(parameters.sphereBatchIds) : void 0;
279
- const numberOfBoxes = defined_default(boxes) ? boxBatchIds.length : 0;
280
- const numberOfCylinders = defined_default(cylinders) ? cylinderBatchIds.length : 0;
281
- const numberOfEllipsoids = defined_default(ellipsoids) ? ellipsoidBatchIds.length : 0;
282
- const numberOfSpheres = defined_default(spheres) ? sphereBatchIds.length : 0;
283
- const boxGeometry = BoxGeometry_default.getUnitBox();
284
- const cylinderGeometry = CylinderGeometry_default.getUnitCylinder();
285
- const ellipsoidGeometry = EllipsoidGeometry_default.getUnitEllipsoid();
286
- const boxPositions = boxGeometry.attributes.position.values;
287
- const cylinderPositions = cylinderGeometry.attributes.position.values;
288
- const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;
289
- let numberOfPositions = boxPositions.length * numberOfBoxes;
290
- numberOfPositions += cylinderPositions.length * numberOfCylinders;
291
- numberOfPositions += ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);
292
- const boxIndices = boxGeometry.indices;
293
- const cylinderIndices = cylinderGeometry.indices;
294
- const ellipsoidIndices = ellipsoidGeometry.indices;
295
- let numberOfIndices = boxIndices.length * numberOfBoxes;
296
- numberOfIndices += cylinderIndices.length * numberOfCylinders;
297
- numberOfIndices += ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);
298
- const positions = new Float32Array(numberOfPositions);
299
- const vertexBatchIds = new Uint16Array(numberOfPositions / 3);
300
- const indices = IndexDatatype_default.createTypedArray(
301
- numberOfPositions / 3,
302
- numberOfIndices
303
- );
304
- const numberOfGeometries = numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
305
- const batchIds = new Uint16Array(numberOfGeometries);
306
- const batchedIndices = new Array(numberOfGeometries);
307
- const indexOffsets = new Uint32Array(numberOfGeometries);
308
- const indexCounts = new Uint32Array(numberOfGeometries);
309
- const boundingVolumes = new Array(numberOfGeometries);
310
- unpackBuffer(parameters.packedBuffer);
311
- const options = {
312
- batchTableColors: new Uint32Array(parameters.batchTableColors),
313
- positions,
314
- vertexBatchIds,
315
- indices,
316
- batchIds,
317
- batchedIndices,
318
- indexOffsets,
319
- indexCounts,
320
- boundingVolumes,
321
- positionOffset: 0,
322
- batchIdIndex: 0,
323
- indexOffset: 0,
324
- batchedIndicesOffset: 0,
325
- modelMatrix: scratchMatrix4,
326
- center: scratchCenter
327
- };
328
- createPrimitive(
329
- options,
330
- boxes,
331
- boxBatchIds,
332
- boxGeometry,
333
- boxModelMatrixAndBoundingVolume
334
- );
335
- createPrimitive(
336
- options,
337
- cylinders,
338
- cylinderBatchIds,
339
- cylinderGeometry,
340
- cylinderModelMatrixAndBoundingVolume
341
- );
342
- createPrimitive(
343
- options,
344
- ellipsoids,
345
- ellipsoidBatchIds,
346
- ellipsoidGeometry,
347
- ellipsoidModelMatrixAndBoundingVolume
348
- );
349
- createPrimitive(
350
- options,
351
- spheres,
352
- sphereBatchIds,
353
- ellipsoidGeometry,
354
- sphereModelMatrixAndBoundingVolume
355
- );
356
- const packedBuffer = packBuffer(
357
- indices.BYTES_PER_ELEMENT,
358
- batchedIndices,
359
- boundingVolumes
360
- );
361
- transferableObjects.push(
362
- positions.buffer,
363
- vertexBatchIds.buffer,
364
- indices.buffer
365
- );
366
- transferableObjects.push(
367
- batchIds.buffer,
368
- indexOffsets.buffer,
369
- indexCounts.buffer
370
- );
371
- transferableObjects.push(packedBuffer.buffer);
372
- return {
373
- positions: positions.buffer,
374
- vertexBatchIds: vertexBatchIds.buffer,
375
- indices: indices.buffer,
376
- indexOffsets: indexOffsets.buffer,
377
- indexCounts: indexCounts.buffer,
378
- batchIds: batchIds.buffer,
379
- packedBuffer: packedBuffer.buffer
380
- };
381
- }
382
- var createVectorTileGeometries_default = createTaskProcessorWorker_default(createVectorTileGeometries);
383
- export {
384
- createVectorTileGeometries_default as default
385
- };
26
+ import{a as P}from"./chunk-HMIYSTF6.js";import{a as z}from"./chunk-GILIDQNQ.js";import"./chunk-ARG42DC4.js";import{a as H}from"./chunk-37F5JSTI.js";import{a as Y}from"./chunk-WZDE3RYP.js";import{a as j}from"./chunk-QN3VOORQ.js";import"./chunk-GBYLG25F.js";import"./chunk-CYCB63OH.js";import{a as W}from"./chunk-OFUUQVMR.js";import"./chunk-A56XVLQR.js";import"./chunk-RCV6KWXS.js";import{d as E}from"./chunk-4IW2T6GF.js";import{b as d}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as o}from"./chunk-64RSHJUE.js";import"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import{e as l}from"./chunk-VTAIKJXX.js";function X(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J=X;var S=new o,$=d.packedLength+o.packedLength,ee=d.packedLength+2,ne=d.packedLength+o.packedLength,te=o.packedLength+1,u={modelMatrix:new d,boundingVolume:new E};function oe(e,c){let n=c*$,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=Math.sqrt(3),u}function ce(e,c){let n=c*ee,i=e[n++],r=e[n++],t=o.fromElements(i,i,r,S),s=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(s,t,s);let h=u.boundingVolume;return o.clone(o.ZERO,h.center),h.radius=Math.sqrt(2),u}function se(e,c){let n=c*ne,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=1,u}function ie(e,c){let n=c*te,i=e[n++],r=o.unpack(e,n,S),t=d.fromTranslation(r,u.modelMatrix);d.multiplyByUniformScale(t,i,t);let s=u.boundingVolume;return o.clone(o.ZERO,s.center),s.radius=1,u}var de=new o;function R(e,c,n,i,r){if(!l(c))return;let t=n.length,s=i.attributes.position.values,h=i.indices,a=e.positions,x=e.vertexBatchIds,y=e.indices,I=e.batchIds,p=e.batchTableColors,T=e.batchedIndices,U=e.indexOffsets,v=e.indexCounts,L=e.boundingVolumes,F=e.modelMatrix,Z=e.center,V=e.positionOffset,B=e.batchIdIndex,O=e.indexOffset,D=e.batchedIndicesOffset;for(let w=0;w<t;++w){let C=r(c,w),k=C.modelMatrix;d.multiply(F,k,k);let M=n[w],A=s.length;for(let f=0;f<A;f+=3){let m=o.unpack(s,f,de);d.multiplyByPoint(k,m,m),o.subtract(m,Z,m),o.pack(m,a,V*3+f),x[B++]=M}let b=h.length;for(let f=0;f<b;++f)y[O+f]=h[f]+V;let g=w+D;T[g]=new J({offset:O,count:b,color:P.fromRgba(p[M]),batchIds:[M]}),I[g]=M,U[g]=O,v[g]=b,L[g]=E.transform(C.boundingVolume,k),V+=A/3,O+=b}e.positionOffset=V,e.batchIdIndex=B,e.indexOffset=O,e.batchedIndicesOffset+=t}var K=new o,Q=new d;function re(e){let c=new Float64Array(e),n=0;o.unpack(c,n,K),n+=o.packedLength,d.unpack(c,n,Q)}function le(e){let c=e.length,n=0;for(let i=0;i<c;++i)n+=P.packedLength+3+e[i].batchIds.length;return n}function ae(e,c,n){let i=n.length,r=2+i*E.packedLength+1+le(c),t=new Float64Array(r),s=0;t[s++]=e,t[s++]=i;for(let a=0;a<i;++a)E.pack(n[a],t,s),s+=E.packedLength;let h=c.length;t[s++]=h;for(let a=0;a<h;++a){let x=c[a];P.pack(x.color,t,s),s+=P.packedLength,t[s++]=x.offset,t[s++]=x.count;let y=x.batchIds,I=y.length;t[s++]=I;for(let p=0;p<I;++p)t[s++]=y[p]}return t}function fe(e,c){let n=l(e.boxes)?new Float32Array(e.boxes):void 0,i=l(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,r=l(e.cylinders)?new Float32Array(e.cylinders):void 0,t=l(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,s=l(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=l(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,a=l(e.spheres)?new Float32Array(e.spheres):void 0,x=l(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=l(n)?i.length:0,I=l(r)?t.length:0,p=l(s)?h.length:0,T=l(a)?x.length:0,U=j.getUnitBox(),v=z.getUnitCylinder(),L=H.getUnitEllipsoid(),F=U.attributes.position.values,Z=v.attributes.position.values,V=L.attributes.position.values,B=F.length*y;B+=Z.length*I,B+=V.length*(p+T);let O=U.indices,D=v.indices,w=L.indices,C=O.length*y;C+=D.length*I,C+=w.length*(p+T);let k=new Float32Array(B),M=new Uint16Array(B/3),A=W.createTypedArray(B/3,C),b=y+I+p+T,g=new Uint16Array(b),f=new Array(b),m=new Uint32Array(b),q=new Uint32Array(b),_=new Array(b);re(e.packedBuffer);let G={batchTableColors:new Uint32Array(e.batchTableColors),positions:k,vertexBatchIds:M,indices:A,batchIds:g,batchedIndices:f,indexOffsets:m,indexCounts:q,boundingVolumes:_,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:Q,center:K};R(G,n,i,U,oe),R(G,r,t,v,ce),R(G,s,h,L,se),R(G,a,x,L,ie);let N=ae(A.BYTES_PER_ELEMENT,f,_);return c.push(k.buffer,M.buffer,A.buffer),c.push(g.buffer,m.buffer,q.buffer),c.push(N.buffer),{positions:k.buffer,vertexBatchIds:M.buffer,indices:A.buffer,indexOffsets:m.buffer,indexCounts:q.buffer,batchIds:g.buffer,packedBuffer:N.buffer}}var Oe=Y(fe);export{Oe as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,90 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- createTaskProcessorWorker_default
28
- } from "./chunk-5ODQSF26.js";
29
- import {
30
- AttributeCompression_default
31
- } from "./chunk-NGPPMXRM.js";
32
- import {
33
- Rectangle_default
34
- } from "./chunk-5PTXS2GO.js";
35
- import "./chunk-K4GQUNB5.js";
36
- import {
37
- Cartesian3_default,
38
- Cartographic_default,
39
- Ellipsoid_default
40
- } from "./chunk-YFXQECWV.js";
41
- import {
42
- Math_default
43
- } from "./chunk-XY4BATBS.js";
44
- import "./chunk-MXIZJAPH.js";
45
- import "./chunk-6CHGCNMW.js";
46
- import "./chunk-7JO7GPJN.js";
47
- import "./chunk-AD63PIY6.js";
48
- import "./chunk-E63IIM5T.js";
49
-
50
- // packages/engine/Source/Workers/createVectorTilePoints.js
51
- var maxShort = 32767;
52
- var scratchBVCartographic = new Cartographic_default();
53
- var scratchEncodedPosition = new Cartesian3_default();
54
- var scratchRectangle = new Rectangle_default();
55
- var scratchEllipsoid = new Ellipsoid_default();
56
- var scratchMinMaxHeights = {
57
- min: void 0,
58
- max: void 0
59
- };
60
- function unpackBuffer(packedBuffer) {
61
- packedBuffer = new Float64Array(packedBuffer);
62
- let offset = 0;
63
- scratchMinMaxHeights.min = packedBuffer[offset++];
64
- scratchMinMaxHeights.max = packedBuffer[offset++];
65
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
66
- offset += Rectangle_default.packedLength;
67
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
68
- }
69
- function createVectorTilePoints(parameters, transferableObjects) {
70
- const positions = new Uint16Array(parameters.positions);
71
- unpackBuffer(parameters.packedBuffer);
72
- const rectangle = scratchRectangle;
73
- const ellipsoid = scratchEllipsoid;
74
- const minimumHeight = scratchMinMaxHeights.min;
75
- const maximumHeight = scratchMinMaxHeights.max;
76
- const positionsLength = positions.length / 3;
77
- const uBuffer = positions.subarray(0, positionsLength);
78
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
79
- const heightBuffer = positions.subarray(
80
- 2 * positionsLength,
81
- 3 * positionsLength
82
- );
83
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
84
- const decoded = new Float64Array(positions.length);
85
- for (let i = 0; i < positionsLength; ++i) {
86
- const u = uBuffer[i];
87
- const v = vBuffer[i];
88
- const h = heightBuffer[i];
89
- const lon = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
90
- const lat = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
91
- const alt = Math_default.lerp(minimumHeight, maximumHeight, h / maxShort);
92
- const cartographic = Cartographic_default.fromRadians(
93
- lon,
94
- lat,
95
- alt,
96
- scratchBVCartographic
97
- );
98
- const decodedPosition = ellipsoid.cartographicToCartesian(
99
- cartographic,
100
- scratchEncodedPosition
101
- );
102
- Cartesian3_default.pack(decodedPosition, decoded, i * 3);
103
- }
104
- transferableObjects.push(decoded.buffer);
105
- return {
106
- positions: decoded.buffer
107
- };
108
- }
109
- var createVectorTilePoints_default = createTaskProcessorWorker_default(createVectorTilePoints);
110
- export {
111
- createVectorTilePoints_default as default
112
- };
26
+ import{a as x}from"./chunk-WZDE3RYP.js";import{a as w}from"./chunk-DEPHB2WM.js";import{h as c}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as h,b as l,d as p}from"./chunk-64RSHJUE.js";import{a as i}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import"./chunk-VTAIKJXX.js";var u=32767,F=new l,L=new h,b=new c,y=new p,a={min:void 0,max:void 0};function V(t){t=new Float64Array(t);let o=0;a.min=t[o++],a.max=t[o++],c.unpack(t,o,b),o+=c.packedLength,p.unpack(t,o,y)}function z(t,o){let s=new Uint16Array(t.positions);V(t.packedBuffer);let e=b,C=y,A=a.min,P=a.max,n=s.length/3,f=s.subarray(0,n),g=s.subarray(n,2*n),d=s.subarray(2*n,3*n);w.zigZagDeltaDecode(f,g,d);let m=new Float64Array(s.length);for(let r=0;r<n;++r){let k=f[r],E=g[r],H=d[r],M=i.lerp(e.west,e.east,k/u),R=i.lerp(e.south,e.north,E/u),T=i.lerp(A,P,H/u),v=l.fromRadians(M,R,T,F),D=C.cartographicToCartesian(v,L);h.pack(D,m,r*3)}return o.push(m.buffer),{positions:m.buffer}}var G=x(z);export{G as default};