deeptwins-cesium-engine 0.1.4 → 0.1.5

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 (113) hide show
  1. package/Build/Workers/chunk-25EUEBF2.js +124 -0
  2. package/Build/Workers/chunk-2CAKI5VM.js +57 -0
  3. package/Build/Workers/chunk-2QJB3UQS.js +693 -0
  4. package/Build/Workers/chunk-4NYAIWKE.js +9230 -0
  5. package/Build/Workers/chunk-4UFWOGZY.js +219 -0
  6. package/Build/Workers/chunk-4WQTGBXO.js +101 -0
  7. package/Build/Workers/chunk-5JU3AMGC.js +305 -0
  8. package/Build/Workers/chunk-6G5GV3DZ.js +1344 -0
  9. package/Build/Workers/chunk-6PEUTCFR.js +198 -0
  10. package/Build/Workers/chunk-6R6KMIRZ.js +2342 -0
  11. package/Build/Workers/chunk-77GTDBAP.js +56 -0
  12. package/Build/Workers/chunk-7EIO4FD6.js +959 -0
  13. package/Build/Workers/chunk-7LAIAVBB.js +58 -0
  14. package/Build/Workers/chunk-7WWTFKKO.js +368 -0
  15. package/Build/Workers/chunk-7Y2RBWWM.js +38 -0
  16. package/Build/Workers/chunk-AKD5GQ6U.js +2719 -0
  17. package/Build/Workers/chunk-ALLK4PGJ.js +789 -0
  18. package/Build/Workers/chunk-AMF27T27.js +56 -0
  19. package/Build/Workers/chunk-BK4QH7VE.js +414 -0
  20. package/Build/Workers/chunk-BVKS7HHS.js +973 -0
  21. package/Build/Workers/chunk-DSQHAHOK.js +837 -0
  22. package/Build/Workers/chunk-EGJXVWHV.js +1054 -0
  23. package/Build/Workers/chunk-ENS5SOS4.js +511 -0
  24. package/Build/Workers/chunk-FQR6XCLN.js +162 -0
  25. package/Build/Workers/chunk-FSWIXRGZ.js +497 -0
  26. package/Build/Workers/chunk-GBT2N74U.js +163 -0
  27. package/Build/Workers/chunk-HGEAXEOZ.js +280 -0
  28. package/Build/Workers/chunk-HQZEFF4Z.js +454 -0
  29. package/Build/Workers/chunk-I4QYOM5K.js +455 -0
  30. package/Build/Workers/chunk-IHE2N4VH.js +288 -0
  31. package/Build/Workers/chunk-JCS3XT73.js +82 -0
  32. package/Build/Workers/chunk-KCH6EOD4.js +352 -0
  33. package/Build/Workers/chunk-LV4OI5ID.js +387 -0
  34. package/Build/Workers/chunk-MFZKRTYB.js +1483 -0
  35. package/Build/Workers/chunk-MUWZDPXK.js +1800 -0
  36. package/Build/Workers/chunk-NESWM54C.js +682 -0
  37. package/Build/Workers/chunk-ODULNNLO.js +1287 -0
  38. package/Build/Workers/chunk-OL5H7YBQ.js +352 -0
  39. package/Build/Workers/chunk-OZ2IRN2C.js +778 -0
  40. package/Build/Workers/chunk-P4UBHYRZ.js +97 -0
  41. package/Build/Workers/chunk-PPWA7GXB.js +44 -0
  42. package/Build/Workers/chunk-QBIOFX7R.js +301 -0
  43. package/Build/Workers/chunk-RD45JEP7.js +1067 -0
  44. package/Build/Workers/chunk-RER7IKLT.js +3792 -0
  45. package/Build/Workers/chunk-RYZFATWN.js +102 -0
  46. package/Build/Workers/chunk-S2QSARI3.js +171 -0
  47. package/Build/Workers/chunk-S5JQY4HG.js +241 -0
  48. package/Build/Workers/chunk-TBJLMQRB.js +73 -0
  49. package/Build/Workers/chunk-UNZDKQSP.js +476 -0
  50. package/Build/Workers/chunk-USCOUU3R.js +138 -0
  51. package/Build/Workers/chunk-XPE3XXMD.js +630 -0
  52. package/Build/Workers/chunk-XSA5DY4V.js +147 -0
  53. package/Build/Workers/chunk-XYSBQE34.js +398 -0
  54. package/Build/Workers/chunk-YWX7P76L.js +3201 -0
  55. package/Build/Workers/chunk-ZLZGNFFR.js +278 -0
  56. package/Build/Workers/chunk-ZNXRMW7W.js +140 -0
  57. package/Build/Workers/chunk-ZXZCQCUS.js +1992 -0
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Renderer/TextureAtlas.js +240 -43
  112. package/index.js +314 -314
  113. package/package.json +1 -1
@@ -0,0 +1,278 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.1.5
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
+ WebGLConstants_default
28
+ } from "./chunk-XPE3XXMD.js";
29
+ import {
30
+ DeveloperError_default
31
+ } from "./chunk-GBT2N74U.js";
32
+ import {
33
+ defined_default
34
+ } from "./chunk-JCS3XT73.js";
35
+
36
+ // packages/engine/Source/Core/ComponentDatatype.js
37
+ var ComponentDatatype = {
38
+ /**
39
+ * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
40
+ * of an element in <code>Int8Array</code>.
41
+ *
42
+ * @type {number}
43
+ * @constant
44
+ */
45
+ BYTE: WebGLConstants_default.BYTE,
46
+ /**
47
+ * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
48
+ * of an element in <code>Uint8Array</code>.
49
+ *
50
+ * @type {number}
51
+ * @constant
52
+ */
53
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
54
+ /**
55
+ * 16-bit signed short corresponding to <code>SHORT</code> and the type
56
+ * of an element in <code>Int16Array</code>.
57
+ *
58
+ * @type {number}
59
+ * @constant
60
+ */
61
+ SHORT: WebGLConstants_default.SHORT,
62
+ /**
63
+ * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
64
+ * of an element in <code>Uint16Array</code>.
65
+ *
66
+ * @type {number}
67
+ * @constant
68
+ */
69
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
70
+ /**
71
+ * 32-bit signed int corresponding to <code>INT</code> and the type
72
+ * of an element in <code>Int32Array</code>.
73
+ *
74
+ * @memberOf ComponentDatatype
75
+ *
76
+ * @type {number}
77
+ * @constant
78
+ */
79
+ INT: WebGLConstants_default.INT,
80
+ /**
81
+ * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
82
+ * of an element in <code>Uint32Array</code>.
83
+ *
84
+ * @memberOf ComponentDatatype
85
+ *
86
+ * @type {number}
87
+ * @constant
88
+ */
89
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT,
90
+ /**
91
+ * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
92
+ * of an element in <code>Float32Array</code>.
93
+ *
94
+ * @type {number}
95
+ * @constant
96
+ */
97
+ FLOAT: WebGLConstants_default.FLOAT,
98
+ /**
99
+ * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
100
+ * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
101
+ * and the type of an element in <code>Float64Array</code>.
102
+ *
103
+ * @memberOf ComponentDatatype
104
+ *
105
+ * @type {number}
106
+ * @constant
107
+ * @default 0x140A
108
+ */
109
+ DOUBLE: WebGLConstants_default.DOUBLE
110
+ };
111
+ ComponentDatatype.getSizeInBytes = function(componentDatatype) {
112
+ if (!defined_default(componentDatatype)) {
113
+ throw new DeveloperError_default("value is required.");
114
+ }
115
+ switch (componentDatatype) {
116
+ case ComponentDatatype.BYTE:
117
+ return Int8Array.BYTES_PER_ELEMENT;
118
+ case ComponentDatatype.UNSIGNED_BYTE:
119
+ return Uint8Array.BYTES_PER_ELEMENT;
120
+ case ComponentDatatype.SHORT:
121
+ return Int16Array.BYTES_PER_ELEMENT;
122
+ case ComponentDatatype.UNSIGNED_SHORT:
123
+ return Uint16Array.BYTES_PER_ELEMENT;
124
+ case ComponentDatatype.INT:
125
+ return Int32Array.BYTES_PER_ELEMENT;
126
+ case ComponentDatatype.UNSIGNED_INT:
127
+ return Uint32Array.BYTES_PER_ELEMENT;
128
+ case ComponentDatatype.FLOAT:
129
+ return Float32Array.BYTES_PER_ELEMENT;
130
+ case ComponentDatatype.DOUBLE:
131
+ return Float64Array.BYTES_PER_ELEMENT;
132
+ //>>includeStart('debug', pragmas.debug);
133
+ default:
134
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
135
+ }
136
+ };
137
+ ComponentDatatype.fromTypedArray = function(array) {
138
+ if (array instanceof Int8Array) {
139
+ return ComponentDatatype.BYTE;
140
+ }
141
+ if (array instanceof Uint8Array) {
142
+ return ComponentDatatype.UNSIGNED_BYTE;
143
+ }
144
+ if (array instanceof Int16Array) {
145
+ return ComponentDatatype.SHORT;
146
+ }
147
+ if (array instanceof Uint16Array) {
148
+ return ComponentDatatype.UNSIGNED_SHORT;
149
+ }
150
+ if (array instanceof Int32Array) {
151
+ return ComponentDatatype.INT;
152
+ }
153
+ if (array instanceof Uint32Array) {
154
+ return ComponentDatatype.UNSIGNED_INT;
155
+ }
156
+ if (array instanceof Float32Array) {
157
+ return ComponentDatatype.FLOAT;
158
+ }
159
+ if (array instanceof Float64Array) {
160
+ return ComponentDatatype.DOUBLE;
161
+ }
162
+ throw new DeveloperError_default(
163
+ "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
164
+ );
165
+ };
166
+ ComponentDatatype.validate = function(componentDatatype) {
167
+ return defined_default(componentDatatype) && (componentDatatype === ComponentDatatype.BYTE || componentDatatype === ComponentDatatype.UNSIGNED_BYTE || componentDatatype === ComponentDatatype.SHORT || componentDatatype === ComponentDatatype.UNSIGNED_SHORT || componentDatatype === ComponentDatatype.INT || componentDatatype === ComponentDatatype.UNSIGNED_INT || componentDatatype === ComponentDatatype.FLOAT || componentDatatype === ComponentDatatype.DOUBLE);
168
+ };
169
+ ComponentDatatype.createTypedArray = function(componentDatatype, valuesOrLength) {
170
+ if (!defined_default(componentDatatype)) {
171
+ throw new DeveloperError_default("componentDatatype is required.");
172
+ }
173
+ if (!defined_default(valuesOrLength)) {
174
+ throw new DeveloperError_default("valuesOrLength is required.");
175
+ }
176
+ switch (componentDatatype) {
177
+ case ComponentDatatype.BYTE:
178
+ return new Int8Array(valuesOrLength);
179
+ case ComponentDatatype.UNSIGNED_BYTE:
180
+ return new Uint8Array(valuesOrLength);
181
+ case ComponentDatatype.SHORT:
182
+ return new Int16Array(valuesOrLength);
183
+ case ComponentDatatype.UNSIGNED_SHORT:
184
+ return new Uint16Array(valuesOrLength);
185
+ case ComponentDatatype.INT:
186
+ return new Int32Array(valuesOrLength);
187
+ case ComponentDatatype.UNSIGNED_INT:
188
+ return new Uint32Array(valuesOrLength);
189
+ case ComponentDatatype.FLOAT:
190
+ return new Float32Array(valuesOrLength);
191
+ case ComponentDatatype.DOUBLE:
192
+ return new Float64Array(valuesOrLength);
193
+ //>>includeStart('debug', pragmas.debug);
194
+ default:
195
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
196
+ }
197
+ };
198
+ ComponentDatatype.createArrayBufferView = function(componentDatatype, buffer, byteOffset, length) {
199
+ if (!defined_default(componentDatatype)) {
200
+ throw new DeveloperError_default("componentDatatype is required.");
201
+ }
202
+ if (!defined_default(buffer)) {
203
+ throw new DeveloperError_default("buffer is required.");
204
+ }
205
+ byteOffset = byteOffset ?? 0;
206
+ length = length ?? (buffer.byteLength - byteOffset) / ComponentDatatype.getSizeInBytes(componentDatatype);
207
+ switch (componentDatatype) {
208
+ case ComponentDatatype.BYTE:
209
+ return new Int8Array(buffer, byteOffset, length);
210
+ case ComponentDatatype.UNSIGNED_BYTE:
211
+ return new Uint8Array(buffer, byteOffset, length);
212
+ case ComponentDatatype.SHORT:
213
+ return new Int16Array(buffer, byteOffset, length);
214
+ case ComponentDatatype.UNSIGNED_SHORT:
215
+ return new Uint16Array(buffer, byteOffset, length);
216
+ case ComponentDatatype.INT:
217
+ return new Int32Array(buffer, byteOffset, length);
218
+ case ComponentDatatype.UNSIGNED_INT:
219
+ return new Uint32Array(buffer, byteOffset, length);
220
+ case ComponentDatatype.FLOAT:
221
+ return new Float32Array(buffer, byteOffset, length);
222
+ case ComponentDatatype.DOUBLE:
223
+ return new Float64Array(buffer, byteOffset, length);
224
+ //>>includeStart('debug', pragmas.debug);
225
+ default:
226
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
227
+ }
228
+ };
229
+ ComponentDatatype.fromName = function(name) {
230
+ switch (name) {
231
+ case "BYTE":
232
+ return ComponentDatatype.BYTE;
233
+ case "UNSIGNED_BYTE":
234
+ return ComponentDatatype.UNSIGNED_BYTE;
235
+ case "SHORT":
236
+ return ComponentDatatype.SHORT;
237
+ case "UNSIGNED_SHORT":
238
+ return ComponentDatatype.UNSIGNED_SHORT;
239
+ case "INT":
240
+ return ComponentDatatype.INT;
241
+ case "UNSIGNED_INT":
242
+ return ComponentDatatype.UNSIGNED_INT;
243
+ case "FLOAT":
244
+ return ComponentDatatype.FLOAT;
245
+ case "DOUBLE":
246
+ return ComponentDatatype.DOUBLE;
247
+ //>>includeStart('debug', pragmas.debug);
248
+ default:
249
+ throw new DeveloperError_default("name is not a valid value.");
250
+ }
251
+ };
252
+ ComponentDatatype.dequantize = function(value, componentDatatype) {
253
+ switch (componentDatatype) {
254
+ case ComponentDatatype.BYTE:
255
+ return Math.max(value / 127, -1);
256
+ case ComponentDatatype.UNSIGNED_BYTE:
257
+ return value / 255;
258
+ case ComponentDatatype.SHORT:
259
+ return Math.max(value / 32767, -1);
260
+ case ComponentDatatype.UNSIGNED_SHORT:
261
+ return value / 65535;
262
+ case ComponentDatatype.INT:
263
+ return Math.max(value / 2147483647, -1);
264
+ case ComponentDatatype.UNSIGNED_INT:
265
+ return value / 4294967295;
266
+ //>>includeStart('debug', pragmas.debug);
267
+ default:
268
+ throw new DeveloperError_default(
269
+ "componentDatatype is not a valid integer type for dequantization."
270
+ );
271
+ }
272
+ };
273
+ Object.freeze(ComponentDatatype);
274
+ var ComponentDatatype_default = ComponentDatatype;
275
+
276
+ export {
277
+ ComponentDatatype_default
278
+ };
@@ -0,0 +1,140 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.1.5
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
+ WebGLConstants_default
28
+ } from "./chunk-XPE3XXMD.js";
29
+ import {
30
+ Math_default
31
+ } from "./chunk-FSWIXRGZ.js";
32
+ import {
33
+ DeveloperError_default
34
+ } from "./chunk-GBT2N74U.js";
35
+ import {
36
+ defined_default
37
+ } from "./chunk-JCS3XT73.js";
38
+
39
+ // packages/engine/Source/Core/IndexDatatype.js
40
+ var IndexDatatype = {
41
+ /**
42
+ * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
43
+ * of an element in <code>Uint8Array</code>.
44
+ *
45
+ * @type {number}
46
+ * @constant
47
+ */
48
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
49
+ /**
50
+ * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
51
+ * of an element in <code>Uint16Array</code>.
52
+ *
53
+ * @type {number}
54
+ * @constant
55
+ */
56
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
57
+ /**
58
+ * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
59
+ * of an element in <code>Uint32Array</code>.
60
+ *
61
+ * @type {number}
62
+ * @constant
63
+ */
64
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT
65
+ };
66
+ IndexDatatype.getSizeInBytes = function(indexDatatype) {
67
+ switch (indexDatatype) {
68
+ case IndexDatatype.UNSIGNED_BYTE:
69
+ return Uint8Array.BYTES_PER_ELEMENT;
70
+ case IndexDatatype.UNSIGNED_SHORT:
71
+ return Uint16Array.BYTES_PER_ELEMENT;
72
+ case IndexDatatype.UNSIGNED_INT:
73
+ return Uint32Array.BYTES_PER_ELEMENT;
74
+ }
75
+ throw new DeveloperError_default(
76
+ "indexDatatype is required and must be a valid IndexDatatype constant."
77
+ );
78
+ };
79
+ IndexDatatype.fromSizeInBytes = function(sizeInBytes) {
80
+ switch (sizeInBytes) {
81
+ case 2:
82
+ return IndexDatatype.UNSIGNED_SHORT;
83
+ case 4:
84
+ return IndexDatatype.UNSIGNED_INT;
85
+ case 1:
86
+ return IndexDatatype.UNSIGNED_BYTE;
87
+ //>>includeStart('debug', pragmas.debug);
88
+ default:
89
+ throw new DeveloperError_default(
90
+ "Size in bytes cannot be mapped to an IndexDatatype"
91
+ );
92
+ }
93
+ };
94
+ IndexDatatype.validate = function(indexDatatype) {
95
+ return defined_default(indexDatatype) && (indexDatatype === IndexDatatype.UNSIGNED_BYTE || indexDatatype === IndexDatatype.UNSIGNED_SHORT || indexDatatype === IndexDatatype.UNSIGNED_INT);
96
+ };
97
+ IndexDatatype.createTypedArray = function(numberOfVertices, indicesLengthOrArray) {
98
+ if (!defined_default(numberOfVertices)) {
99
+ throw new DeveloperError_default("numberOfVertices is required.");
100
+ }
101
+ if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
102
+ return new Uint32Array(indicesLengthOrArray);
103
+ }
104
+ return new Uint16Array(indicesLengthOrArray);
105
+ };
106
+ IndexDatatype.createTypedArrayFromArrayBuffer = function(numberOfVertices, sourceArray, byteOffset, length) {
107
+ if (!defined_default(numberOfVertices)) {
108
+ throw new DeveloperError_default("numberOfVertices is required.");
109
+ }
110
+ if (!defined_default(sourceArray)) {
111
+ throw new DeveloperError_default("sourceArray is required.");
112
+ }
113
+ if (!defined_default(byteOffset)) {
114
+ throw new DeveloperError_default("byteOffset is required.");
115
+ }
116
+ if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
117
+ return new Uint32Array(sourceArray, byteOffset, length);
118
+ }
119
+ return new Uint16Array(sourceArray, byteOffset, length);
120
+ };
121
+ IndexDatatype.fromTypedArray = function(array) {
122
+ if (array instanceof Uint8Array) {
123
+ return IndexDatatype.UNSIGNED_BYTE;
124
+ }
125
+ if (array instanceof Uint16Array) {
126
+ return IndexDatatype.UNSIGNED_SHORT;
127
+ }
128
+ if (array instanceof Uint32Array) {
129
+ return IndexDatatype.UNSIGNED_INT;
130
+ }
131
+ throw new DeveloperError_default(
132
+ "array must be a Uint8Array, Uint16Array, or Uint32Array."
133
+ );
134
+ };
135
+ Object.freeze(IndexDatatype);
136
+ var IndexDatatype_default = IndexDatatype;
137
+
138
+ export {
139
+ IndexDatatype_default
140
+ };