@rtzh/engine 0.0.1 → 0.0.3

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 (115) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/Source/Scene/Model/CustomShader.js +2 -2
  3. package/index.js +504 -504
  4. package/package.json +1 -1
  5. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  6. package/Build/Workers/chunk-245NZYCR.js +0 -124
  7. package/Build/Workers/chunk-25BA4527.js +0 -837
  8. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  9. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  10. package/Build/Workers/chunk-55IROWAX.js +0 -139
  11. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  12. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  13. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  14. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  15. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  16. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  17. package/Build/Workers/chunk-6XJO625E.js +0 -497
  18. package/Build/Workers/chunk-75UGCVME.js +0 -102
  19. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  20. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  21. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  22. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  23. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  24. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  25. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  26. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  27. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  28. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  29. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  30. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  31. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  32. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  33. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  34. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  35. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  36. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  37. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  38. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  39. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  40. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  41. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  42. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  43. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  44. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  45. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  46. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  47. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  48. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  49. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  50. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  51. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  52. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  53. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  54. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  55. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  56. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  57. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  58. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  59. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  60. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  61. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  62. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  63. package/Build/Workers/combineGeometry.js +0 -66
  64. package/Build/Workers/createBoxGeometry.js +0 -58
  65. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  66. package/Build/Workers/createCircleGeometry.js +0 -201
  67. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  68. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  69. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  70. package/Build/Workers/createCorridorGeometry.js +0 -1258
  71. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  72. package/Build/Workers/createCylinderGeometry.js +0 -60
  73. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  74. package/Build/Workers/createEllipseGeometry.js +0 -72
  75. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  76. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  77. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  78. package/Build/Workers/createFrustumGeometry.js +0 -58
  79. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  80. package/Build/Workers/createGeometry.js +0 -173
  81. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  82. package/Build/Workers/createPlaneGeometry.js +0 -223
  83. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  84. package/Build/Workers/createPolygonGeometry.js +0 -1404
  85. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  86. package/Build/Workers/createPolylineGeometry.js +0 -491
  87. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  88. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  89. package/Build/Workers/createRectangleGeometry.js +0 -1264
  90. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  91. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  92. package/Build/Workers/createSphereGeometry.js +0 -116
  93. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  94. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  95. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  96. package/Build/Workers/createVectorTileGeometries.js +0 -387
  97. package/Build/Workers/createVectorTilePoints.js +0 -114
  98. package/Build/Workers/createVectorTilePolygons.js +0 -386
  99. package/Build/Workers/createVectorTilePolylines.js +0 -262
  100. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  101. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  102. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  103. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  104. package/Build/Workers/createWallGeometry.js +0 -487
  105. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  106. package/Build/Workers/decodeDraco.js +0 -369
  107. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  108. package/Build/Workers/decodeI3S.js +0 -1339
  109. package/Build/Workers/gaussianSplatSorter.js +0 -62
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  112. package/Build/Workers/transcodeKTX2.js +0 -3463
  113. package/Build/Workers/transferTypedArrayTest.js +0 -41
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,387 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
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-JFO3ELF3.js";
29
- import {
30
- CylinderGeometry_default
31
- } from "./chunk-KVE5EAPO.js";
32
- import "./chunk-TWF4XRZ6.js";
33
- import {
34
- EllipsoidGeometry_default
35
- } from "./chunk-S3AE3MZZ.js";
36
- import {
37
- createTaskProcessorWorker_default
38
- } from "./chunk-TSAJNE4K.js";
39
- import {
40
- BoxGeometry_default
41
- } from "./chunk-ELXGXAYS.js";
42
- import "./chunk-6H33B6OL.js";
43
- import "./chunk-I76SRIKN.js";
44
- import {
45
- IndexDatatype_default
46
- } from "./chunk-55IROWAX.js";
47
- import "./chunk-BOV6T7FO.js";
48
- import "./chunk-XOVHLPKW.js";
49
- import {
50
- BoundingSphere_default
51
- } from "./chunk-OAOREOSO.js";
52
- import "./chunk-EKMWNF4U.js";
53
- import "./chunk-KQIZ7AFF.js";
54
- import {
55
- Matrix4_default
56
- } from "./chunk-POY6ZE32.js";
57
- import "./chunk-AL22JVIA.js";
58
- import "./chunk-5VZISKJF.js";
59
- import "./chunk-UYT2PBMV.js";
60
- import "./chunk-YPGJSFOO.js";
61
- import {
62
- Cartesian3_default
63
- } from "./chunk-QWV2DM66.js";
64
- import "./chunk-6XJO625E.js";
65
- import "./chunk-KH2OWUUA.js";
66
- import {
67
- defined_default
68
- } from "./chunk-AVSQILVI.js";
69
-
70
- // packages/engine/Source/Scene/Vector3DTileBatch.js
71
- function Vector3DTileBatch(options) {
72
- this.offset = options.offset;
73
- this.count = options.count;
74
- this.color = options.color;
75
- this.batchIds = options.batchIds;
76
- }
77
- var Vector3DTileBatch_default = Vector3DTileBatch;
78
-
79
- // packages/engine/Source/Workers/createVectorTileGeometries.js
80
- var scratchCartesian = new Cartesian3_default();
81
- var packedBoxLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
82
- var packedCylinderLength = Matrix4_default.packedLength + 2;
83
- var packedEllipsoidLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
84
- var packedSphereLength = Cartesian3_default.packedLength + 1;
85
- var scratchModelMatrixAndBV = {
86
- modelMatrix: new Matrix4_default(),
87
- boundingVolume: new BoundingSphere_default()
88
- };
89
- function boxModelMatrixAndBoundingVolume(boxes, index) {
90
- let boxIndex = index * packedBoxLength;
91
- const dimensions = Cartesian3_default.unpack(boxes, boxIndex, scratchCartesian);
92
- boxIndex += Cartesian3_default.packedLength;
93
- const boxModelMatrix = Matrix4_default.unpack(
94
- boxes,
95
- boxIndex,
96
- scratchModelMatrixAndBV.modelMatrix
97
- );
98
- Matrix4_default.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);
99
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
100
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
101
- boundingVolume.radius = Math.sqrt(3);
102
- return scratchModelMatrixAndBV;
103
- }
104
- function cylinderModelMatrixAndBoundingVolume(cylinders, index) {
105
- let cylinderIndex = index * packedCylinderLength;
106
- const cylinderRadius = cylinders[cylinderIndex++];
107
- const length = cylinders[cylinderIndex++];
108
- const scale = Cartesian3_default.fromElements(
109
- cylinderRadius,
110
- cylinderRadius,
111
- length,
112
- scratchCartesian
113
- );
114
- const cylinderModelMatrix = Matrix4_default.unpack(
115
- cylinders,
116
- cylinderIndex,
117
- scratchModelMatrixAndBV.modelMatrix
118
- );
119
- Matrix4_default.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);
120
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
121
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
122
- boundingVolume.radius = Math.sqrt(2);
123
- return scratchModelMatrixAndBV;
124
- }
125
- function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {
126
- let ellipsoidIndex = index * packedEllipsoidLength;
127
- const radii = Cartesian3_default.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);
128
- ellipsoidIndex += Cartesian3_default.packedLength;
129
- const ellipsoidModelMatrix = Matrix4_default.unpack(
130
- ellipsoids,
131
- ellipsoidIndex,
132
- scratchModelMatrixAndBV.modelMatrix
133
- );
134
- Matrix4_default.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);
135
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
136
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
137
- boundingVolume.radius = 1;
138
- return scratchModelMatrixAndBV;
139
- }
140
- function sphereModelMatrixAndBoundingVolume(spheres, index) {
141
- let sphereIndex = index * packedSphereLength;
142
- const sphereRadius = spheres[sphereIndex++];
143
- const sphereTranslation = Cartesian3_default.unpack(
144
- spheres,
145
- sphereIndex,
146
- scratchCartesian
147
- );
148
- const sphereModelMatrix = Matrix4_default.fromTranslation(
149
- sphereTranslation,
150
- scratchModelMatrixAndBV.modelMatrix
151
- );
152
- Matrix4_default.multiplyByUniformScale(
153
- sphereModelMatrix,
154
- sphereRadius,
155
- sphereModelMatrix
156
- );
157
- const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
158
- Cartesian3_default.clone(Cartesian3_default.ZERO, boundingVolume.center);
159
- boundingVolume.radius = 1;
160
- return scratchModelMatrixAndBV;
161
- }
162
- var scratchPosition = new Cartesian3_default();
163
- function createPrimitive(options, primitive, primitiveBatchIds, geometry, getModelMatrixAndBoundingVolume) {
164
- if (!defined_default(primitive)) {
165
- return;
166
- }
167
- const numberOfPrimitives = primitiveBatchIds.length;
168
- const geometryPositions = geometry.attributes.position.values;
169
- const geometryIndices = geometry.indices;
170
- const positions = options.positions;
171
- const vertexBatchIds = options.vertexBatchIds;
172
- const indices = options.indices;
173
- const batchIds = options.batchIds;
174
- const batchTableColors = options.batchTableColors;
175
- const batchedIndices = options.batchedIndices;
176
- const indexOffsets = options.indexOffsets;
177
- const indexCounts = options.indexCounts;
178
- const boundingVolumes = options.boundingVolumes;
179
- const modelMatrix = options.modelMatrix;
180
- const center = options.center;
181
- let positionOffset = options.positionOffset;
182
- let batchIdIndex = options.batchIdIndex;
183
- let indexOffset = options.indexOffset;
184
- const batchedIndicesOffset = options.batchedIndicesOffset;
185
- for (let i = 0; i < numberOfPrimitives; ++i) {
186
- const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(
187
- primitive,
188
- i
189
- );
190
- const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;
191
- Matrix4_default.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);
192
- const batchId = primitiveBatchIds[i];
193
- const positionsLength = geometryPositions.length;
194
- for (let j = 0; j < positionsLength; j += 3) {
195
- const position = Cartesian3_default.unpack(geometryPositions, j, scratchPosition);
196
- Matrix4_default.multiplyByPoint(primitiveModelMatrix, position, position);
197
- Cartesian3_default.subtract(position, center, position);
198
- Cartesian3_default.pack(position, positions, positionOffset * 3 + j);
199
- vertexBatchIds[batchIdIndex++] = batchId;
200
- }
201
- const indicesLength = geometryIndices.length;
202
- for (let k = 0; k < indicesLength; ++k) {
203
- indices[indexOffset + k] = geometryIndices[k] + positionOffset;
204
- }
205
- const offset = i + batchedIndicesOffset;
206
- batchedIndices[offset] = new Vector3DTileBatch_default({
207
- offset: indexOffset,
208
- count: indicesLength,
209
- color: Color_default.fromRgba(batchTableColors[batchId]),
210
- batchIds: [batchId]
211
- });
212
- batchIds[offset] = batchId;
213
- indexOffsets[offset] = indexOffset;
214
- indexCounts[offset] = indicesLength;
215
- boundingVolumes[offset] = BoundingSphere_default.transform(
216
- primitiveModelMatrixAndBV.boundingVolume,
217
- primitiveModelMatrix
218
- );
219
- positionOffset += positionsLength / 3;
220
- indexOffset += indicesLength;
221
- }
222
- options.positionOffset = positionOffset;
223
- options.batchIdIndex = batchIdIndex;
224
- options.indexOffset = indexOffset;
225
- options.batchedIndicesOffset += numberOfPrimitives;
226
- }
227
- var scratchCenter = new Cartesian3_default();
228
- var scratchMatrix4 = new Matrix4_default();
229
- function unpackBuffer(buffer) {
230
- const packedBuffer = new Float64Array(buffer);
231
- let offset = 0;
232
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
233
- offset += Cartesian3_default.packedLength;
234
- Matrix4_default.unpack(packedBuffer, offset, scratchMatrix4);
235
- }
236
- function packedBatchedIndicesLength(batchedIndices) {
237
- const length = batchedIndices.length;
238
- let count = 0;
239
- for (let i = 0; i < length; ++i) {
240
- count += Color_default.packedLength + 3 + batchedIndices[i].batchIds.length;
241
- }
242
- return count;
243
- }
244
- function packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {
245
- const numBVs = boundingVolumes.length;
246
- const length = 1 + 1 + numBVs * BoundingSphere_default.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
247
- const packedBuffer = new Float64Array(length);
248
- let offset = 0;
249
- packedBuffer[offset++] = indicesBytesPerElement;
250
- packedBuffer[offset++] = numBVs;
251
- for (let i = 0; i < numBVs; ++i) {
252
- BoundingSphere_default.pack(boundingVolumes[i], packedBuffer, offset);
253
- offset += BoundingSphere_default.packedLength;
254
- }
255
- const indicesLength = batchedIndices.length;
256
- packedBuffer[offset++] = indicesLength;
257
- for (let j = 0; j < indicesLength; ++j) {
258
- const batchedIndex = batchedIndices[j];
259
- Color_default.pack(batchedIndex.color, packedBuffer, offset);
260
- offset += Color_default.packedLength;
261
- packedBuffer[offset++] = batchedIndex.offset;
262
- packedBuffer[offset++] = batchedIndex.count;
263
- const batchIds = batchedIndex.batchIds;
264
- const batchIdsLength = batchIds.length;
265
- packedBuffer[offset++] = batchIdsLength;
266
- for (let k = 0; k < batchIdsLength; ++k) {
267
- packedBuffer[offset++] = batchIds[k];
268
- }
269
- }
270
- return packedBuffer;
271
- }
272
- function createVectorTileGeometries(parameters, transferableObjects) {
273
- const boxes = defined_default(parameters.boxes) ? new Float32Array(parameters.boxes) : void 0;
274
- const boxBatchIds = defined_default(parameters.boxBatchIds) ? new Uint16Array(parameters.boxBatchIds) : void 0;
275
- const cylinders = defined_default(parameters.cylinders) ? new Float32Array(parameters.cylinders) : void 0;
276
- const cylinderBatchIds = defined_default(parameters.cylinderBatchIds) ? new Uint16Array(parameters.cylinderBatchIds) : void 0;
277
- const ellipsoids = defined_default(parameters.ellipsoids) ? new Float32Array(parameters.ellipsoids) : void 0;
278
- const ellipsoidBatchIds = defined_default(parameters.ellipsoidBatchIds) ? new Uint16Array(parameters.ellipsoidBatchIds) : void 0;
279
- const spheres = defined_default(parameters.spheres) ? new Float32Array(parameters.spheres) : void 0;
280
- const sphereBatchIds = defined_default(parameters.sphereBatchIds) ? new Uint16Array(parameters.sphereBatchIds) : void 0;
281
- const numberOfBoxes = defined_default(boxes) ? boxBatchIds.length : 0;
282
- const numberOfCylinders = defined_default(cylinders) ? cylinderBatchIds.length : 0;
283
- const numberOfEllipsoids = defined_default(ellipsoids) ? ellipsoidBatchIds.length : 0;
284
- const numberOfSpheres = defined_default(spheres) ? sphereBatchIds.length : 0;
285
- const boxGeometry = BoxGeometry_default.getUnitBox();
286
- const cylinderGeometry = CylinderGeometry_default.getUnitCylinder();
287
- const ellipsoidGeometry = EllipsoidGeometry_default.getUnitEllipsoid();
288
- const boxPositions = boxGeometry.attributes.position.values;
289
- const cylinderPositions = cylinderGeometry.attributes.position.values;
290
- const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;
291
- let numberOfPositions = boxPositions.length * numberOfBoxes;
292
- numberOfPositions += cylinderPositions.length * numberOfCylinders;
293
- numberOfPositions += ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);
294
- const boxIndices = boxGeometry.indices;
295
- const cylinderIndices = cylinderGeometry.indices;
296
- const ellipsoidIndices = ellipsoidGeometry.indices;
297
- let numberOfIndices = boxIndices.length * numberOfBoxes;
298
- numberOfIndices += cylinderIndices.length * numberOfCylinders;
299
- numberOfIndices += ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);
300
- const positions = new Float32Array(numberOfPositions);
301
- const vertexBatchIds = new Uint16Array(numberOfPositions / 3);
302
- const indices = IndexDatatype_default.createTypedArray(
303
- numberOfPositions / 3,
304
- numberOfIndices
305
- );
306
- const numberOfGeometries = numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
307
- const batchIds = new Uint16Array(numberOfGeometries);
308
- const batchedIndices = new Array(numberOfGeometries);
309
- const indexOffsets = new Uint32Array(numberOfGeometries);
310
- const indexCounts = new Uint32Array(numberOfGeometries);
311
- const boundingVolumes = new Array(numberOfGeometries);
312
- unpackBuffer(parameters.packedBuffer);
313
- const options = {
314
- batchTableColors: new Uint32Array(parameters.batchTableColors),
315
- positions,
316
- vertexBatchIds,
317
- indices,
318
- batchIds,
319
- batchedIndices,
320
- indexOffsets,
321
- indexCounts,
322
- boundingVolumes,
323
- positionOffset: 0,
324
- batchIdIndex: 0,
325
- indexOffset: 0,
326
- batchedIndicesOffset: 0,
327
- modelMatrix: scratchMatrix4,
328
- center: scratchCenter
329
- };
330
- createPrimitive(
331
- options,
332
- boxes,
333
- boxBatchIds,
334
- boxGeometry,
335
- boxModelMatrixAndBoundingVolume
336
- );
337
- createPrimitive(
338
- options,
339
- cylinders,
340
- cylinderBatchIds,
341
- cylinderGeometry,
342
- cylinderModelMatrixAndBoundingVolume
343
- );
344
- createPrimitive(
345
- options,
346
- ellipsoids,
347
- ellipsoidBatchIds,
348
- ellipsoidGeometry,
349
- ellipsoidModelMatrixAndBoundingVolume
350
- );
351
- createPrimitive(
352
- options,
353
- spheres,
354
- sphereBatchIds,
355
- ellipsoidGeometry,
356
- sphereModelMatrixAndBoundingVolume
357
- );
358
- const packedBuffer = packBuffer(
359
- indices.BYTES_PER_ELEMENT,
360
- batchedIndices,
361
- boundingVolumes
362
- );
363
- transferableObjects.push(
364
- positions.buffer,
365
- vertexBatchIds.buffer,
366
- indices.buffer
367
- );
368
- transferableObjects.push(
369
- batchIds.buffer,
370
- indexOffsets.buffer,
371
- indexCounts.buffer
372
- );
373
- transferableObjects.push(packedBuffer.buffer);
374
- return {
375
- positions: positions.buffer,
376
- vertexBatchIds: vertexBatchIds.buffer,
377
- indices: indices.buffer,
378
- indexOffsets: indexOffsets.buffer,
379
- indexCounts: indexCounts.buffer,
380
- batchIds: batchIds.buffer,
381
- packedBuffer: packedBuffer.buffer
382
- };
383
- }
384
- var createVectorTileGeometries_default = createTaskProcessorWorker_default(createVectorTileGeometries);
385
- export {
386
- createVectorTileGeometries_default as default
387
- };
@@ -1,114 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
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
- createTaskProcessorWorker_default
28
- } from "./chunk-TSAJNE4K.js";
29
- import {
30
- AttributeCompression_default
31
- } from "./chunk-6LZBBEA7.js";
32
- import {
33
- Rectangle_default
34
- } from "./chunk-KQIZ7AFF.js";
35
- import "./chunk-POY6ZE32.js";
36
- import "./chunk-AL22JVIA.js";
37
- import "./chunk-5VZISKJF.js";
38
- import "./chunk-UYT2PBMV.js";
39
- import {
40
- Cartographic_default,
41
- Ellipsoid_default
42
- } from "./chunk-YPGJSFOO.js";
43
- import {
44
- Cartesian3_default
45
- } from "./chunk-QWV2DM66.js";
46
- import {
47
- Math_default
48
- } from "./chunk-6XJO625E.js";
49
- import "./chunk-KH2OWUUA.js";
50
- import "./chunk-AVSQILVI.js";
51
-
52
- // packages/engine/Source/Workers/createVectorTilePoints.js
53
- var maxShort = 32767;
54
- var scratchBVCartographic = new Cartographic_default();
55
- var scratchEncodedPosition = new Cartesian3_default();
56
- var scratchRectangle = new Rectangle_default();
57
- var scratchEllipsoid = new Ellipsoid_default();
58
- var scratchMinMaxHeights = {
59
- min: void 0,
60
- max: void 0
61
- };
62
- function unpackBuffer(packedBuffer) {
63
- packedBuffer = new Float64Array(packedBuffer);
64
- let offset = 0;
65
- scratchMinMaxHeights.min = packedBuffer[offset++];
66
- scratchMinMaxHeights.max = packedBuffer[offset++];
67
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
68
- offset += Rectangle_default.packedLength;
69
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
70
- }
71
- function createVectorTilePoints(parameters, transferableObjects) {
72
- const positions = new Uint16Array(parameters.positions);
73
- unpackBuffer(parameters.packedBuffer);
74
- const rectangle = scratchRectangle;
75
- const ellipsoid = scratchEllipsoid;
76
- const minimumHeight = scratchMinMaxHeights.min;
77
- const maximumHeight = scratchMinMaxHeights.max;
78
- const positionsLength = positions.length / 3;
79
- const uBuffer = positions.subarray(0, positionsLength);
80
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
81
- const heightBuffer = positions.subarray(
82
- 2 * positionsLength,
83
- 3 * positionsLength
84
- );
85
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
86
- const decoded = new Float64Array(positions.length);
87
- for (let i = 0; i < positionsLength; ++i) {
88
- const u = uBuffer[i];
89
- const v = vBuffer[i];
90
- const h = heightBuffer[i];
91
- const lon = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
92
- const lat = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
93
- const alt = Math_default.lerp(minimumHeight, maximumHeight, h / maxShort);
94
- const cartographic = Cartographic_default.fromRadians(
95
- lon,
96
- lat,
97
- alt,
98
- scratchBVCartographic
99
- );
100
- const decodedPosition = ellipsoid.cartographicToCartesian(
101
- cartographic,
102
- scratchEncodedPosition
103
- );
104
- Cartesian3_default.pack(decodedPosition, decoded, i * 3);
105
- }
106
- transferableObjects.push(decoded.buffer);
107
- return {
108
- positions: decoded.buffer
109
- };
110
- }
111
- var createVectorTilePoints_default = createTaskProcessorWorker_default(createVectorTilePoints);
112
- export {
113
- createVectorTilePoints_default as default
114
- };