deeptwins-cesium-engine 0.0.37 → 0.0.39

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 (138) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +3 -3
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +3 -3
  3. package/Build/ThirdParty/Workers/zip-web-worker.js +2 -2
  4. package/Build/Workers/chunk-23I6J5G7.js +398 -0
  5. package/Build/Workers/chunk-2AHRUAHP.js +963 -0
  6. package/Build/Workers/chunk-2EXJYRVL.js +1800 -0
  7. package/Build/Workers/chunk-2KZSEMHE.js +368 -0
  8. package/Build/Workers/chunk-3DT7SFPW.js +959 -0
  9. package/Build/Workers/chunk-3HAZZIZN.js +435 -0
  10. package/Build/Workers/chunk-3JNKFBNK.js +287 -0
  11. package/Build/Workers/chunk-4GPYRP3M.js +157 -0
  12. package/Build/Workers/chunk-4HWJCCN5.js +1481 -0
  13. package/Build/Workers/chunk-4UN6DCKS.js +44 -0
  14. package/Build/Workers/chunk-5AS35AVH.js +101 -0
  15. package/Build/Workers/chunk-5QBKODYV.js +239 -0
  16. package/Build/Workers/chunk-7H2S5BNE.js +196 -0
  17. package/Build/Workers/chunk-7NK5LQGE.js +1055 -0
  18. package/Build/Workers/chunk-7USIJNJO.js +456 -0
  19. package/Build/Workers/chunk-A3LZJ465.js +634 -0
  20. package/Build/Workers/chunk-ACV745U5.js +629 -0
  21. package/Build/Workers/chunk-AF7CI434.js +476 -0
  22. package/Build/Workers/chunk-ARYZWDAD.js +157 -0
  23. package/Build/Workers/chunk-BDVR2XOF.js +305 -0
  24. package/Build/Workers/chunk-CBSLDU73.js +1481 -0
  25. package/Build/Workers/chunk-DD3ISUFZ.js +2717 -0
  26. package/Build/Workers/chunk-DIVAQ6AJ.js +196 -0
  27. package/Build/Workers/chunk-E2LXRH4B.js +390 -0
  28. package/Build/Workers/chunk-ESM3ZWV7.js +781 -0
  29. package/Build/Workers/chunk-EZS63EHQ.js +171 -0
  30. package/Build/Workers/chunk-F3HA5JVH.js +435 -0
  31. package/Build/Workers/chunk-FGQQ4BAX.js +684 -0
  32. package/Build/Workers/chunk-FL4PAMOR.js +100 -0
  33. package/Build/Workers/chunk-FXZPZ42H.js +122 -0
  34. package/Build/Workers/chunk-GBACHWVF.js +171 -0
  35. package/Build/Workers/chunk-GKTDHQWC.js +122 -0
  36. package/Build/Workers/chunk-HBSMOYMV.js +37 -0
  37. package/Build/Workers/chunk-HKLYRUUZ.js +691 -0
  38. package/Build/Workers/chunk-HRSYMVJK.js +511 -0
  39. package/Build/Workers/chunk-IE4WZF5B.js +220 -0
  40. package/Build/Workers/chunk-IXVT26OF.js +163 -0
  41. package/Build/Workers/chunk-IYRRJ6HP.js +262 -0
  42. package/Build/Workers/chunk-JGB65JJZ.js +58 -0
  43. package/Build/Workers/chunk-K4MHMSSB.js +1800 -0
  44. package/Build/Workers/chunk-KZZS6JY6.js +300 -0
  45. package/Build/Workers/chunk-LBBJTH3K.js +2717 -0
  46. package/Build/Workers/chunk-LFYSBTBW.js +963 -0
  47. package/Build/Workers/chunk-LHUR7S4A.js +421 -0
  48. package/Build/Workers/chunk-LNRTQ27Z.js +59 -0
  49. package/Build/Workers/chunk-LOR2HRSE.js +1073 -0
  50. package/Build/Workers/chunk-MCMBUNB4.js +10357 -0
  51. package/Build/Workers/chunk-NCVCDYTD.js +1258 -0
  52. package/Build/Workers/chunk-NS3GCKZS.js +102 -0
  53. package/Build/Workers/chunk-OGSJ5ZP6.js +500 -0
  54. package/Build/Workers/chunk-OH3VVE2G.js +758 -0
  55. package/Build/Workers/chunk-OVXKRRSP.js +305 -0
  56. package/Build/Workers/chunk-OYCWKCSH.js +139 -0
  57. package/Build/Workers/chunk-P53ISV4G.js +1258 -0
  58. package/Build/Workers/chunk-P76UBIMX.js +75 -0
  59. package/Build/Workers/chunk-PPJPELR6.js +834 -0
  60. package/Build/Workers/chunk-PXMNRFPM.js +691 -0
  61. package/Build/Workers/chunk-QW5GG3FR.js +59 -0
  62. package/Build/Workers/chunk-RBFNWURH.js +959 -0
  63. package/Build/Workers/chunk-RCW2L6C3.js +1055 -0
  64. package/Build/Workers/chunk-RO6KFQNC.js +287 -0
  65. package/Build/Workers/chunk-RZIOHE7Z.js +239 -0
  66. package/Build/Workers/chunk-S7VB62PT.js +511 -0
  67. package/Build/Workers/chunk-SS4SBY5P.js +421 -0
  68. package/Build/Workers/chunk-TDUWFVEH.js +300 -0
  69. package/Build/Workers/chunk-UBCK7AIW.js +39 -0
  70. package/Build/Workers/chunk-UDSU5OZZ.js +73 -0
  71. package/Build/Workers/chunk-UWBEXOKK.js +115 -0
  72. package/Build/Workers/chunk-VMHJ465B.js +781 -0
  73. package/Build/Workers/chunk-W3SVGQNY.js +353 -0
  74. package/Build/Workers/chunk-WANNP3AY.js +1073 -0
  75. package/Build/Workers/chunk-WJT5PV2Q.js +220 -0
  76. package/Build/Workers/chunk-X2PKPXPZ.js +10357 -0
  77. package/Build/Workers/chunk-XA76JK4A.js +758 -0
  78. package/Build/Workers/chunk-XAI7HXKB.js +476 -0
  79. package/Build/Workers/chunk-XCTF4LFK.js +138 -0
  80. package/Build/Workers/chunk-XQWSES33.js +55 -0
  81. package/Build/Workers/chunk-XUDMEXSI.js +834 -0
  82. package/Build/Workers/chunk-YNTVI3S3.js +390 -0
  83. package/Build/Workers/chunk-YW6GWBRU.js +368 -0
  84. package/Build/Workers/chunk-YZUNRTF3.js +398 -0
  85. package/Build/Workers/chunk-Z26UX5A7.js +684 -0
  86. package/Build/Workers/chunk-ZPEGWBIN.js +2857 -0
  87. package/Build/Workers/combineGeometry.js +22 -22
  88. package/Build/Workers/createBoxGeometry.js +16 -16
  89. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  90. package/Build/Workers/createCircleGeometry.js +24 -24
  91. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  92. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  93. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  94. package/Build/Workers/createCorridorGeometry.js +27 -27
  95. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  96. package/Build/Workers/createCylinderGeometry.js +18 -18
  97. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  98. package/Build/Workers/createEllipseGeometry.js +24 -24
  99. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  100. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  101. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  102. package/Build/Workers/createFrustumGeometry.js +16 -16
  103. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  104. package/Build/Workers/createGeometry.js +22 -22
  105. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  106. package/Build/Workers/createPlaneGeometry.js +14 -14
  107. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  108. package/Build/Workers/createPolygonGeometry.js +30 -30
  109. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  110. package/Build/Workers/createPolylineGeometry.js +23 -23
  111. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  112. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  113. package/Build/Workers/createRectangleGeometry.js +25 -25
  114. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  115. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  116. package/Build/Workers/createSphereGeometry.js +17 -17
  117. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  118. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  119. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  120. package/Build/Workers/createVectorTileGeometries.js +22 -22
  121. package/Build/Workers/createVectorTilePoints.js +12 -12
  122. package/Build/Workers/createVectorTilePolygons.js +20 -20
  123. package/Build/Workers/createVectorTilePolylines.js +13 -13
  124. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  125. package/Build/Workers/createVerticesFromHeightmap.js +26 -26
  126. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  127. package/Build/Workers/createWallGeometry.js +22 -22
  128. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  129. package/Build/Workers/decodeDraco.js +11 -11
  130. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  131. package/Build/Workers/decodeI3S.js +10 -10
  132. package/Build/Workers/transcodeKTX2.js +62 -54
  133. package/Build/Workers/transferTypedArrayTest.js +1 -1
  134. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  135. package/Source/Renderer/TextureAtlas.js +30 -21
  136. package/Source/Scene/BillboardTexture.js +99 -12
  137. package/index.js +46 -46
  138. package/package.json +1 -1
@@ -0,0 +1,435 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.37
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
+ Cartesian4_default,
28
+ Matrix2_default,
29
+ Matrix4_default
30
+ } from "./chunk-X2PKPXPZ.js";
31
+ import {
32
+ ComponentDatatype_default
33
+ } from "./chunk-T6SZKZ5P.js";
34
+ import {
35
+ Cartesian2_default,
36
+ Cartesian3_default,
37
+ Matrix3_default
38
+ } from "./chunk-O3PMNFMM.js";
39
+ import {
40
+ Math_default
41
+ } from "./chunk-DVR6JMCT.js";
42
+ import {
43
+ Check_default,
44
+ DeveloperError_default
45
+ } from "./chunk-ZQ7S66XP.js";
46
+ import {
47
+ defined_default
48
+ } from "./chunk-5C4JSXR6.js";
49
+
50
+ // packages/engine/Source/Scene/AttributeType.js
51
+ var AttributeType = {
52
+ /**
53
+ * The attribute is a single component.
54
+ *
55
+ * @type {string}
56
+ * @constant
57
+ */
58
+ SCALAR: "SCALAR",
59
+ /**
60
+ * The attribute is a two-component vector.
61
+ *
62
+ * @type {string}
63
+ * @constant
64
+ */
65
+ VEC2: "VEC2",
66
+ /**
67
+ * The attribute is a three-component vector.
68
+ *
69
+ * @type {string}
70
+ * @constant
71
+ */
72
+ VEC3: "VEC3",
73
+ /**
74
+ * The attribute is a four-component vector.
75
+ *
76
+ * @type {string}
77
+ * @constant
78
+ */
79
+ VEC4: "VEC4",
80
+ /**
81
+ * The attribute is a 2x2 matrix.
82
+ *
83
+ * @type {string}
84
+ * @constant
85
+ */
86
+ MAT2: "MAT2",
87
+ /**
88
+ * The attribute is a 3x3 matrix.
89
+ *
90
+ * @type {string}
91
+ * @constant
92
+ */
93
+ MAT3: "MAT3",
94
+ /**
95
+ * The attribute is a 4x4 matrix.
96
+ *
97
+ * @type {string}
98
+ * @constant
99
+ */
100
+ MAT4: "MAT4"
101
+ };
102
+ AttributeType.getMathType = function(attributeType) {
103
+ switch (attributeType) {
104
+ case AttributeType.SCALAR:
105
+ return Number;
106
+ case AttributeType.VEC2:
107
+ return Cartesian2_default;
108
+ case AttributeType.VEC3:
109
+ return Cartesian3_default;
110
+ case AttributeType.VEC4:
111
+ return Cartesian4_default;
112
+ case AttributeType.MAT2:
113
+ return Matrix2_default;
114
+ case AttributeType.MAT3:
115
+ return Matrix3_default;
116
+ case AttributeType.MAT4:
117
+ return Matrix4_default;
118
+ //>>includeStart('debug', pragmas.debug);
119
+ default:
120
+ throw new DeveloperError_default("attributeType is not a valid value.");
121
+ }
122
+ };
123
+ AttributeType.getNumberOfComponents = function(attributeType) {
124
+ switch (attributeType) {
125
+ case AttributeType.SCALAR:
126
+ return 1;
127
+ case AttributeType.VEC2:
128
+ return 2;
129
+ case AttributeType.VEC3:
130
+ return 3;
131
+ case AttributeType.VEC4:
132
+ case AttributeType.MAT2:
133
+ return 4;
134
+ case AttributeType.MAT3:
135
+ return 9;
136
+ case AttributeType.MAT4:
137
+ return 16;
138
+ //>>includeStart('debug', pragmas.debug);
139
+ default:
140
+ throw new DeveloperError_default("attributeType is not a valid value.");
141
+ }
142
+ };
143
+ AttributeType.getAttributeLocationCount = function(attributeType) {
144
+ switch (attributeType) {
145
+ case AttributeType.SCALAR:
146
+ case AttributeType.VEC2:
147
+ case AttributeType.VEC3:
148
+ case AttributeType.VEC4:
149
+ return 1;
150
+ case AttributeType.MAT2:
151
+ return 2;
152
+ case AttributeType.MAT3:
153
+ return 3;
154
+ case AttributeType.MAT4:
155
+ return 4;
156
+ //>>includeStart('debug', pragmas.debug);
157
+ default:
158
+ throw new DeveloperError_default("attributeType is not a valid value.");
159
+ }
160
+ };
161
+ AttributeType.getGlslType = function(attributeType) {
162
+ Check_default.typeOf.string("attributeType", attributeType);
163
+ switch (attributeType) {
164
+ case AttributeType.SCALAR:
165
+ return "float";
166
+ case AttributeType.VEC2:
167
+ return "vec2";
168
+ case AttributeType.VEC3:
169
+ return "vec3";
170
+ case AttributeType.VEC4:
171
+ return "vec4";
172
+ case AttributeType.MAT2:
173
+ return "mat2";
174
+ case AttributeType.MAT3:
175
+ return "mat3";
176
+ case AttributeType.MAT4:
177
+ return "mat4";
178
+ //>>includeStart('debug', pragmas.debug);
179
+ default:
180
+ throw new DeveloperError_default("attributeType is not a valid value.");
181
+ }
182
+ };
183
+ var AttributeType_default = Object.freeze(AttributeType);
184
+
185
+ // packages/engine/Source/Core/AttributeCompression.js
186
+ var RIGHT_SHIFT = 1 / 256;
187
+ var LEFT_SHIFT = 256;
188
+ var AttributeCompression = {};
189
+ AttributeCompression.octEncodeInRange = function(vector, rangeMax, result) {
190
+ Check_default.defined("vector", vector);
191
+ Check_default.defined("result", result);
192
+ const magSquared = Cartesian3_default.magnitudeSquared(vector);
193
+ if (Math.abs(magSquared - 1) > Math_default.EPSILON6) {
194
+ throw new DeveloperError_default("vector must be normalized.");
195
+ }
196
+ result.x = vector.x / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
197
+ result.y = vector.y / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
198
+ if (vector.z < 0) {
199
+ const x = result.x;
200
+ const y = result.y;
201
+ result.x = (1 - Math.abs(y)) * Math_default.signNotZero(x);
202
+ result.y = (1 - Math.abs(x)) * Math_default.signNotZero(y);
203
+ }
204
+ result.x = Math_default.toSNorm(result.x, rangeMax);
205
+ result.y = Math_default.toSNorm(result.y, rangeMax);
206
+ return result;
207
+ };
208
+ AttributeCompression.octEncode = function(vector, result) {
209
+ return AttributeCompression.octEncodeInRange(vector, 255, result);
210
+ };
211
+ var octEncodeScratch = new Cartesian2_default();
212
+ var uint8ForceArray = new Uint8Array(1);
213
+ function forceUint8(value) {
214
+ uint8ForceArray[0] = value;
215
+ return uint8ForceArray[0];
216
+ }
217
+ AttributeCompression.octEncodeToCartesian4 = function(vector, result) {
218
+ AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);
219
+ result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
220
+ result.y = forceUint8(octEncodeScratch.x);
221
+ result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
222
+ result.w = forceUint8(octEncodeScratch.y);
223
+ return result;
224
+ };
225
+ AttributeCompression.octDecodeInRange = function(x, y, rangeMax, result) {
226
+ Check_default.defined("result", result);
227
+ if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
228
+ throw new DeveloperError_default(
229
+ `x and y must be unsigned normalized integers between 0 and ${rangeMax}`
230
+ );
231
+ }
232
+ result.x = Math_default.fromSNorm(x, rangeMax);
233
+ result.y = Math_default.fromSNorm(y, rangeMax);
234
+ result.z = 1 - (Math.abs(result.x) + Math.abs(result.y));
235
+ if (result.z < 0) {
236
+ const oldVX = result.x;
237
+ result.x = (1 - Math.abs(result.y)) * Math_default.signNotZero(oldVX);
238
+ result.y = (1 - Math.abs(oldVX)) * Math_default.signNotZero(result.y);
239
+ }
240
+ return Cartesian3_default.normalize(result, result);
241
+ };
242
+ AttributeCompression.octDecode = function(x, y, result) {
243
+ return AttributeCompression.octDecodeInRange(x, y, 255, result);
244
+ };
245
+ AttributeCompression.octDecodeFromCartesian4 = function(encoded, result) {
246
+ Check_default.typeOf.object("encoded", encoded);
247
+ Check_default.typeOf.object("result", result);
248
+ const x = encoded.x;
249
+ const y = encoded.y;
250
+ const z = encoded.z;
251
+ const w = encoded.w;
252
+ if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
253
+ throw new DeveloperError_default(
254
+ "x, y, z, and w must be unsigned normalized integers between 0 and 255"
255
+ );
256
+ }
257
+ const xOct16 = x * LEFT_SHIFT + y;
258
+ const yOct16 = z * LEFT_SHIFT + w;
259
+ return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);
260
+ };
261
+ AttributeCompression.octPackFloat = function(encoded) {
262
+ Check_default.defined("encoded", encoded);
263
+ return 256 * encoded.x + encoded.y;
264
+ };
265
+ var scratchEncodeCart2 = new Cartesian2_default();
266
+ AttributeCompression.octEncodeFloat = function(vector) {
267
+ AttributeCompression.octEncode(vector, scratchEncodeCart2);
268
+ return AttributeCompression.octPackFloat(scratchEncodeCart2);
269
+ };
270
+ AttributeCompression.octDecodeFloat = function(value, result) {
271
+ Check_default.defined("value", value);
272
+ const temp = value / 256;
273
+ const x = Math.floor(temp);
274
+ const y = (temp - x) * 256;
275
+ return AttributeCompression.octDecode(x, y, result);
276
+ };
277
+ AttributeCompression.octPack = function(v1, v2, v3, result) {
278
+ Check_default.defined("v1", v1);
279
+ Check_default.defined("v2", v2);
280
+ Check_default.defined("v3", v3);
281
+ Check_default.defined("result", result);
282
+ const encoded1 = AttributeCompression.octEncodeFloat(v1);
283
+ const encoded2 = AttributeCompression.octEncodeFloat(v2);
284
+ const encoded3 = AttributeCompression.octEncode(v3, scratchEncodeCart2);
285
+ result.x = 65536 * encoded3.x + encoded1;
286
+ result.y = 65536 * encoded3.y + encoded2;
287
+ return result;
288
+ };
289
+ AttributeCompression.octUnpack = function(packed, v1, v2, v3) {
290
+ Check_default.defined("packed", packed);
291
+ Check_default.defined("v1", v1);
292
+ Check_default.defined("v2", v2);
293
+ Check_default.defined("v3", v3);
294
+ let temp = packed.x / 65536;
295
+ const x = Math.floor(temp);
296
+ const encodedFloat1 = (temp - x) * 65536;
297
+ temp = packed.y / 65536;
298
+ const y = Math.floor(temp);
299
+ const encodedFloat2 = (temp - y) * 65536;
300
+ AttributeCompression.octDecodeFloat(encodedFloat1, v1);
301
+ AttributeCompression.octDecodeFloat(encodedFloat2, v2);
302
+ AttributeCompression.octDecode(x, y, v3);
303
+ };
304
+ AttributeCompression.compressTextureCoordinates = function(textureCoordinates) {
305
+ Check_default.defined("textureCoordinates", textureCoordinates);
306
+ const x = textureCoordinates.x * 4095 | 0;
307
+ const y = textureCoordinates.y * 4095 | 0;
308
+ return 4096 * x + y;
309
+ };
310
+ AttributeCompression.decompressTextureCoordinates = function(compressed, result) {
311
+ Check_default.defined("compressed", compressed);
312
+ Check_default.defined("result", result);
313
+ const temp = compressed / 4096;
314
+ const xZeroTo4095 = Math.floor(temp);
315
+ result.x = xZeroTo4095 / 4095;
316
+ result.y = (compressed - xZeroTo4095 * 4096) / 4095;
317
+ return result;
318
+ };
319
+ function zigZagDecode(value) {
320
+ return value >> 1 ^ -(value & 1);
321
+ }
322
+ AttributeCompression.zigZagDeltaDecode = function(uBuffer, vBuffer, heightBuffer) {
323
+ Check_default.defined("uBuffer", uBuffer);
324
+ Check_default.defined("vBuffer", vBuffer);
325
+ Check_default.typeOf.number.equals(
326
+ "uBuffer.length",
327
+ "vBuffer.length",
328
+ uBuffer.length,
329
+ vBuffer.length
330
+ );
331
+ if (defined_default(heightBuffer)) {
332
+ Check_default.typeOf.number.equals(
333
+ "uBuffer.length",
334
+ "heightBuffer.length",
335
+ uBuffer.length,
336
+ heightBuffer.length
337
+ );
338
+ }
339
+ const count = uBuffer.length;
340
+ let u = 0;
341
+ let v = 0;
342
+ let height = 0;
343
+ for (let i = 0; i < count; ++i) {
344
+ u += zigZagDecode(uBuffer[i]);
345
+ v += zigZagDecode(vBuffer[i]);
346
+ uBuffer[i] = u;
347
+ vBuffer[i] = v;
348
+ if (defined_default(heightBuffer)) {
349
+ height += zigZagDecode(heightBuffer[i]);
350
+ heightBuffer[i] = height;
351
+ }
352
+ }
353
+ };
354
+ AttributeCompression.dequantize = function(typedArray, componentDatatype, type, count) {
355
+ Check_default.defined("typedArray", typedArray);
356
+ Check_default.defined("componentDatatype", componentDatatype);
357
+ Check_default.defined("type", type);
358
+ Check_default.defined("count", count);
359
+ const componentsPerAttribute = AttributeType_default.getNumberOfComponents(type);
360
+ let divisor;
361
+ switch (componentDatatype) {
362
+ case ComponentDatatype_default.BYTE:
363
+ divisor = 127;
364
+ break;
365
+ case ComponentDatatype_default.UNSIGNED_BYTE:
366
+ divisor = 255;
367
+ break;
368
+ case ComponentDatatype_default.SHORT:
369
+ divisor = 32767;
370
+ break;
371
+ case ComponentDatatype_default.UNSIGNED_SHORT:
372
+ divisor = 65535;
373
+ break;
374
+ case ComponentDatatype_default.INT:
375
+ divisor = 2147483647;
376
+ break;
377
+ case ComponentDatatype_default.UNSIGNED_INT:
378
+ divisor = 4294967295;
379
+ break;
380
+ //>>includeStart('debug', pragmas.debug);
381
+ default:
382
+ throw new DeveloperError_default(
383
+ `Cannot dequantize component datatype: ${componentDatatype}`
384
+ );
385
+ }
386
+ const dequantizedTypedArray = new Float32Array(
387
+ count * componentsPerAttribute
388
+ );
389
+ for (let i = 0; i < count; i++) {
390
+ for (let j = 0; j < componentsPerAttribute; j++) {
391
+ const index = i * componentsPerAttribute + j;
392
+ dequantizedTypedArray[index] = Math.max(
393
+ typedArray[index] / divisor,
394
+ -1
395
+ );
396
+ }
397
+ }
398
+ return dequantizedTypedArray;
399
+ };
400
+ AttributeCompression.decodeRGB565 = function(typedArray, result) {
401
+ Check_default.defined("typedArray", typedArray);
402
+ const expectedLength = typedArray.length * 3;
403
+ if (defined_default(result)) {
404
+ Check_default.typeOf.number.equals(
405
+ "result.length",
406
+ "typedArray.length * 3",
407
+ result.length,
408
+ expectedLength
409
+ );
410
+ }
411
+ const count = typedArray.length;
412
+ if (!defined_default(result)) {
413
+ result = new Float32Array(count * 3);
414
+ }
415
+ const mask5 = (1 << 5) - 1;
416
+ const mask6 = (1 << 6) - 1;
417
+ const normalize5 = 1 / 31;
418
+ const normalize6 = 1 / 63;
419
+ for (let i = 0; i < count; i++) {
420
+ const value = typedArray[i];
421
+ const red = value >> 11;
422
+ const green = value >> 5 & mask6;
423
+ const blue = value & mask5;
424
+ const offset = 3 * i;
425
+ result[offset] = red * normalize5;
426
+ result[offset + 1] = green * normalize6;
427
+ result[offset + 2] = blue * normalize5;
428
+ }
429
+ return result;
430
+ };
431
+ var AttributeCompression_default = AttributeCompression;
432
+
433
+ export {
434
+ AttributeCompression_default
435
+ };
@@ -0,0 +1,287 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.38
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
+ AxisAlignedBoundingBox_default
28
+ } from "./chunk-4GPYRP3M.js";
29
+ import {
30
+ IntersectionTests_default,
31
+ Ray_default
32
+ } from "./chunk-NCVCDYTD.js";
33
+ import {
34
+ Plane_default
35
+ } from "./chunk-EZS63EHQ.js";
36
+ import {
37
+ Cartesian4_default,
38
+ Matrix4_default,
39
+ Transforms_default
40
+ } from "./chunk-MCMBUNB4.js";
41
+ import {
42
+ Cartesian2_default,
43
+ Cartesian3_default,
44
+ Ellipsoid_default
45
+ } from "./chunk-ZPEGWBIN.js";
46
+ import {
47
+ defaultValue_default
48
+ } from "./chunk-UBCK7AIW.js";
49
+ import {
50
+ Check_default,
51
+ DeveloperError_default
52
+ } from "./chunk-IXVT26OF.js";
53
+ import {
54
+ defined_default
55
+ } from "./chunk-P76UBIMX.js";
56
+
57
+ // packages/engine/Source/Core/EllipsoidTangentPlane.js
58
+ var scratchCart4 = new Cartesian4_default();
59
+ function EllipsoidTangentPlane(origin, ellipsoid) {
60
+ Check_default.defined("origin", origin);
61
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.default);
62
+ origin = ellipsoid.scaleToGeodeticSurface(origin);
63
+ if (!defined_default(origin)) {
64
+ throw new DeveloperError_default(
65
+ "origin must not be at the center of the ellipsoid."
66
+ );
67
+ }
68
+ const eastNorthUp = Transforms_default.eastNorthUpToFixedFrame(origin, ellipsoid);
69
+ this._ellipsoid = ellipsoid;
70
+ this._origin = origin;
71
+ this._xAxis = Cartesian3_default.fromCartesian4(
72
+ Matrix4_default.getColumn(eastNorthUp, 0, scratchCart4)
73
+ );
74
+ this._yAxis = Cartesian3_default.fromCartesian4(
75
+ Matrix4_default.getColumn(eastNorthUp, 1, scratchCart4)
76
+ );
77
+ const normal = Cartesian3_default.fromCartesian4(
78
+ Matrix4_default.getColumn(eastNorthUp, 2, scratchCart4)
79
+ );
80
+ this._plane = Plane_default.fromPointNormal(origin, normal);
81
+ }
82
+ Object.defineProperties(EllipsoidTangentPlane.prototype, {
83
+ /**
84
+ * Gets the ellipsoid.
85
+ * @memberof EllipsoidTangentPlane.prototype
86
+ * @type {Ellipsoid}
87
+ */
88
+ ellipsoid: {
89
+ get: function() {
90
+ return this._ellipsoid;
91
+ }
92
+ },
93
+ /**
94
+ * Gets the origin.
95
+ * @memberof EllipsoidTangentPlane.prototype
96
+ * @type {Cartesian3}
97
+ */
98
+ origin: {
99
+ get: function() {
100
+ return this._origin;
101
+ }
102
+ },
103
+ /**
104
+ * Gets the plane which is tangent to the ellipsoid.
105
+ * @memberof EllipsoidTangentPlane.prototype
106
+ * @readonly
107
+ * @type {Plane}
108
+ */
109
+ plane: {
110
+ get: function() {
111
+ return this._plane;
112
+ }
113
+ },
114
+ /**
115
+ * Gets the local X-axis (east) of the tangent plane.
116
+ * @memberof EllipsoidTangentPlane.prototype
117
+ * @readonly
118
+ * @type {Cartesian3}
119
+ */
120
+ xAxis: {
121
+ get: function() {
122
+ return this._xAxis;
123
+ }
124
+ },
125
+ /**
126
+ * Gets the local Y-axis (north) of the tangent plane.
127
+ * @memberof EllipsoidTangentPlane.prototype
128
+ * @readonly
129
+ * @type {Cartesian3}
130
+ */
131
+ yAxis: {
132
+ get: function() {
133
+ return this._yAxis;
134
+ }
135
+ },
136
+ /**
137
+ * Gets the local Z-axis (up) of the tangent plane.
138
+ * @memberof EllipsoidTangentPlane.prototype
139
+ * @readonly
140
+ * @type {Cartesian3}
141
+ */
142
+ zAxis: {
143
+ get: function() {
144
+ return this._plane.normal;
145
+ }
146
+ }
147
+ });
148
+ var tmp = new AxisAlignedBoundingBox_default();
149
+ EllipsoidTangentPlane.fromPoints = function(cartesians, ellipsoid) {
150
+ Check_default.defined("cartesians", cartesians);
151
+ const box = AxisAlignedBoundingBox_default.fromPoints(cartesians, tmp);
152
+ return new EllipsoidTangentPlane(box.center, ellipsoid);
153
+ };
154
+ var scratchProjectPointOntoPlaneRay = new Ray_default();
155
+ var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
156
+ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function(cartesian, result) {
157
+ Check_default.defined("cartesian", cartesian);
158
+ const ray = scratchProjectPointOntoPlaneRay;
159
+ ray.origin = cartesian;
160
+ Cartesian3_default.normalize(cartesian, ray.direction);
161
+ let intersectionPoint = IntersectionTests_default.rayPlane(
162
+ ray,
163
+ this._plane,
164
+ scratchProjectPointOntoPlaneCartesian3
165
+ );
166
+ if (!defined_default(intersectionPoint)) {
167
+ Cartesian3_default.negate(ray.direction, ray.direction);
168
+ intersectionPoint = IntersectionTests_default.rayPlane(
169
+ ray,
170
+ this._plane,
171
+ scratchProjectPointOntoPlaneCartesian3
172
+ );
173
+ }
174
+ if (defined_default(intersectionPoint)) {
175
+ const v = Cartesian3_default.subtract(
176
+ intersectionPoint,
177
+ this._origin,
178
+ intersectionPoint
179
+ );
180
+ const x = Cartesian3_default.dot(this._xAxis, v);
181
+ const y = Cartesian3_default.dot(this._yAxis, v);
182
+ if (!defined_default(result)) {
183
+ return new Cartesian2_default(x, y);
184
+ }
185
+ result.x = x;
186
+ result.y = y;
187
+ return result;
188
+ }
189
+ return void 0;
190
+ };
191
+ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(cartesians, result) {
192
+ Check_default.defined("cartesians", cartesians);
193
+ if (!defined_default(result)) {
194
+ result = [];
195
+ }
196
+ let count = 0;
197
+ const length = cartesians.length;
198
+ for (let i = 0; i < length; i++) {
199
+ const p = this.projectPointOntoPlane(cartesians[i], result[count]);
200
+ if (defined_default(p)) {
201
+ result[count] = p;
202
+ count++;
203
+ }
204
+ }
205
+ result.length = count;
206
+ return result;
207
+ };
208
+ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function(cartesian, result) {
209
+ Check_default.defined("cartesian", cartesian);
210
+ if (!defined_default(result)) {
211
+ result = new Cartesian2_default();
212
+ }
213
+ const ray = scratchProjectPointOntoPlaneRay;
214
+ ray.origin = cartesian;
215
+ Cartesian3_default.clone(this._plane.normal, ray.direction);
216
+ let intersectionPoint = IntersectionTests_default.rayPlane(
217
+ ray,
218
+ this._plane,
219
+ scratchProjectPointOntoPlaneCartesian3
220
+ );
221
+ if (!defined_default(intersectionPoint)) {
222
+ Cartesian3_default.negate(ray.direction, ray.direction);
223
+ intersectionPoint = IntersectionTests_default.rayPlane(
224
+ ray,
225
+ this._plane,
226
+ scratchProjectPointOntoPlaneCartesian3
227
+ );
228
+ }
229
+ const v = Cartesian3_default.subtract(
230
+ intersectionPoint,
231
+ this._origin,
232
+ intersectionPoint
233
+ );
234
+ const x = Cartesian3_default.dot(this._xAxis, v);
235
+ const y = Cartesian3_default.dot(this._yAxis, v);
236
+ result.x = x;
237
+ result.y = y;
238
+ return result;
239
+ };
240
+ EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function(cartesians, result) {
241
+ Check_default.defined("cartesians", cartesians);
242
+ if (!defined_default(result)) {
243
+ result = [];
244
+ }
245
+ const length = cartesians.length;
246
+ result.length = length;
247
+ for (let i = 0; i < length; i++) {
248
+ result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
249
+ }
250
+ return result;
251
+ };
252
+ var projectPointsOntoEllipsoidScratch = new Cartesian3_default();
253
+ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function(cartesian, result) {
254
+ Check_default.defined("cartesian", cartesian);
255
+ if (!defined_default(result)) {
256
+ result = new Cartesian3_default();
257
+ }
258
+ const ellipsoid = this._ellipsoid;
259
+ const origin = this._origin;
260
+ const xAxis = this._xAxis;
261
+ const yAxis = this._yAxis;
262
+ const tmp2 = projectPointsOntoEllipsoidScratch;
263
+ Cartesian3_default.multiplyByScalar(xAxis, cartesian.x, tmp2);
264
+ result = Cartesian3_default.add(origin, tmp2, result);
265
+ Cartesian3_default.multiplyByScalar(yAxis, cartesian.y, tmp2);
266
+ Cartesian3_default.add(result, tmp2, result);
267
+ ellipsoid.scaleToGeocentricSurface(result, result);
268
+ return result;
269
+ };
270
+ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(cartesians, result) {
271
+ Check_default.defined("cartesians", cartesians);
272
+ const length = cartesians.length;
273
+ if (!defined_default(result)) {
274
+ result = new Array(length);
275
+ } else {
276
+ result.length = length;
277
+ }
278
+ for (let i = 0; i < length; ++i) {
279
+ result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
280
+ }
281
+ return result;
282
+ };
283
+ var EllipsoidTangentPlane_default = EllipsoidTangentPlane;
284
+
285
+ export {
286
+ EllipsoidTangentPlane_default
287
+ };