deeptwins-cesium-engine 0.0.39 → 0.0.40

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 (104) hide show
  1. package/Build/Workers/chunk-22YARAUJ.js +629 -0
  2. package/Build/Workers/chunk-2HVM4MOI.js +220 -0
  3. package/Build/Workers/chunk-2PWEYBYR.js +75 -0
  4. package/Build/Workers/chunk-2ZI2BRKI.js +37 -0
  5. package/Build/Workers/chunk-3Q6HPHTH.js +684 -0
  6. package/Build/Workers/chunk-4LE3SGQH.js +634 -0
  7. package/Build/Workers/chunk-5IBSBFAA.js +287 -0
  8. package/Build/Workers/chunk-5ZELPLWF.js +58 -0
  9. package/Build/Workers/chunk-73EDFMPB.js +1073 -0
  10. package/Build/Workers/chunk-ALIDMMNJ.js +10357 -0
  11. package/Build/Workers/chunk-AXTXYHVG.js +59 -0
  12. package/Build/Workers/chunk-B3DSUDQQ.js +101 -0
  13. package/Build/Workers/chunk-B7R4KLQV.js +959 -0
  14. package/Build/Workers/chunk-CET7MMFD.js +1055 -0
  15. package/Build/Workers/chunk-DGWWFN6L.js +102 -0
  16. package/Build/Workers/chunk-DPZEBUVY.js +122 -0
  17. package/Build/Workers/chunk-EKUYACAZ.js +163 -0
  18. package/Build/Workers/chunk-ETQJFLBY.js +435 -0
  19. package/Build/Workers/chunk-HDJDQBU6.js +758 -0
  20. package/Build/Workers/chunk-HOO3H5M5.js +171 -0
  21. package/Build/Workers/chunk-JRFRSSGD.js +1800 -0
  22. package/Build/Workers/chunk-KMDXAR34.js +1481 -0
  23. package/Build/Workers/chunk-KZDZFG2L.js +157 -0
  24. package/Build/Workers/chunk-LDXSEGOX.js +2857 -0
  25. package/Build/Workers/chunk-LYJFG66W.js +196 -0
  26. package/Build/Workers/chunk-N2UJHZ4W.js +368 -0
  27. package/Build/Workers/chunk-NZU4VBYI.js +834 -0
  28. package/Build/Workers/chunk-OY2Z6SFD.js +100 -0
  29. package/Build/Workers/chunk-PA4JZFFM.js +353 -0
  30. package/Build/Workers/chunk-QUJ6BNQF.js +39 -0
  31. package/Build/Workers/chunk-ROPEB47Y.js +300 -0
  32. package/Build/Workers/chunk-S3RIIJID.js +781 -0
  33. package/Build/Workers/chunk-SPS2I45W.js +73 -0
  34. package/Build/Workers/chunk-TBJBVKDE.js +262 -0
  35. package/Build/Workers/chunk-TJAONFQM.js +44 -0
  36. package/Build/Workers/chunk-TJNJ6CLS.js +239 -0
  37. package/Build/Workers/chunk-U4SUBL6L.js +390 -0
  38. package/Build/Workers/chunk-U6RITS73.js +456 -0
  39. package/Build/Workers/chunk-UHPBZJQF.js +2717 -0
  40. package/Build/Workers/chunk-UHS2YM44.js +115 -0
  41. package/Build/Workers/chunk-UN3RMNI2.js +500 -0
  42. package/Build/Workers/chunk-UYS2HZVM.js +421 -0
  43. package/Build/Workers/chunk-VSEDVQN7.js +305 -0
  44. package/Build/Workers/chunk-W7KOAHR2.js +691 -0
  45. package/Build/Workers/chunk-WGHS4HMU.js +55 -0
  46. package/Build/Workers/chunk-XV4SYFDP.js +138 -0
  47. package/Build/Workers/chunk-XX7RETEX.js +1258 -0
  48. package/Build/Workers/chunk-XYMJZUFF.js +476 -0
  49. package/Build/Workers/chunk-YCU6WHSN.js +963 -0
  50. package/Build/Workers/chunk-YWEX5QFW.js +398 -0
  51. package/Build/Workers/chunk-Z2WOKKJM.js +511 -0
  52. package/Build/Workers/chunk-ZYUOPFWQ.js +139 -0
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +24 -24
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +27 -27
  61. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +30 -30
  75. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  76. package/Build/Workers/createPolylineGeometry.js +23 -23
  77. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  79. package/Build/Workers/createRectangleGeometry.js +25 -25
  80. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  81. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +20 -20
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +22 -22
  94. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  95. package/Build/Workers/decodeDraco.js +11 -11
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +7 -7
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Scene/Billboard.js +22 -0
  102. package/Source/Scene/BillboardTexture.js +92 -2
  103. package/index.js +97 -97
  104. package/package.json +1 -1
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.39
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
+ Math_default
28
+ } from "./chunk-UN3RMNI2.js";
29
+
30
+ // packages/engine/Source/Core/CylinderGeometryLibrary.js
31
+ var CylinderGeometryLibrary = {};
32
+ CylinderGeometryLibrary.computePositions = function(length, topRadius, bottomRadius, slices, fill) {
33
+ const topZ = length * 0.5;
34
+ const bottomZ = -topZ;
35
+ const twoSlice = slices + slices;
36
+ const size = fill ? 2 * twoSlice : twoSlice;
37
+ const positions = new Float64Array(size * 3);
38
+ let i;
39
+ let index = 0;
40
+ let tbIndex = 0;
41
+ const bottomOffset = fill ? twoSlice * 3 : 0;
42
+ const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;
43
+ for (i = 0; i < slices; i++) {
44
+ const angle = i / slices * Math_default.TWO_PI;
45
+ const x = Math.cos(angle);
46
+ const y = Math.sin(angle);
47
+ const bottomX = x * bottomRadius;
48
+ const bottomY = y * bottomRadius;
49
+ const topX = x * topRadius;
50
+ const topY = y * topRadius;
51
+ positions[tbIndex + bottomOffset] = bottomX;
52
+ positions[tbIndex + bottomOffset + 1] = bottomY;
53
+ positions[tbIndex + bottomOffset + 2] = bottomZ;
54
+ positions[tbIndex + topOffset] = topX;
55
+ positions[tbIndex + topOffset + 1] = topY;
56
+ positions[tbIndex + topOffset + 2] = topZ;
57
+ tbIndex += 3;
58
+ if (fill) {
59
+ positions[index++] = bottomX;
60
+ positions[index++] = bottomY;
61
+ positions[index++] = bottomZ;
62
+ positions[index++] = topX;
63
+ positions[index++] = topY;
64
+ positions[index++] = topZ;
65
+ }
66
+ }
67
+ return positions;
68
+ };
69
+ var CylinderGeometryLibrary_default = CylinderGeometryLibrary;
70
+
71
+ export {
72
+ CylinderGeometryLibrary_default
73
+ };
@@ -0,0 +1,262 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.39
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-22YARAUJ.js";
29
+ import {
30
+ defaultValue_default
31
+ } from "./chunk-QUJ6BNQF.js";
32
+ import {
33
+ DeveloperError_default
34
+ } from "./chunk-EKUYACAZ.js";
35
+ import {
36
+ defined_default
37
+ } from "./chunk-2PWEYBYR.js";
38
+
39
+ // packages/engine/Source/Core/ComponentDatatype.js
40
+ var ComponentDatatype = {
41
+ /**
42
+ * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
43
+ * of an element in <code>Int8Array</code>.
44
+ *
45
+ * @type {number}
46
+ * @constant
47
+ */
48
+ BYTE: WebGLConstants_default.BYTE,
49
+ /**
50
+ * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
51
+ * of an element in <code>Uint8Array</code>.
52
+ *
53
+ * @type {number}
54
+ * @constant
55
+ */
56
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
57
+ /**
58
+ * 16-bit signed short corresponding to <code>SHORT</code> and the type
59
+ * of an element in <code>Int16Array</code>.
60
+ *
61
+ * @type {number}
62
+ * @constant
63
+ */
64
+ SHORT: WebGLConstants_default.SHORT,
65
+ /**
66
+ * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
67
+ * of an element in <code>Uint16Array</code>.
68
+ *
69
+ * @type {number}
70
+ * @constant
71
+ */
72
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
73
+ /**
74
+ * 32-bit signed int corresponding to <code>INT</code> and the type
75
+ * of an element in <code>Int32Array</code>.
76
+ *
77
+ * @memberOf ComponentDatatype
78
+ *
79
+ * @type {number}
80
+ * @constant
81
+ */
82
+ INT: WebGLConstants_default.INT,
83
+ /**
84
+ * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
85
+ * of an element in <code>Uint32Array</code>.
86
+ *
87
+ * @memberOf ComponentDatatype
88
+ *
89
+ * @type {number}
90
+ * @constant
91
+ */
92
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT,
93
+ /**
94
+ * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
95
+ * of an element in <code>Float32Array</code>.
96
+ *
97
+ * @type {number}
98
+ * @constant
99
+ */
100
+ FLOAT: WebGLConstants_default.FLOAT,
101
+ /**
102
+ * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
103
+ * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
104
+ * and the type of an element in <code>Float64Array</code>.
105
+ *
106
+ * @memberOf ComponentDatatype
107
+ *
108
+ * @type {number}
109
+ * @constant
110
+ * @default 0x140A
111
+ */
112
+ DOUBLE: WebGLConstants_default.DOUBLE
113
+ };
114
+ ComponentDatatype.getSizeInBytes = function(componentDatatype) {
115
+ if (!defined_default(componentDatatype)) {
116
+ throw new DeveloperError_default("value is required.");
117
+ }
118
+ switch (componentDatatype) {
119
+ case ComponentDatatype.BYTE:
120
+ return Int8Array.BYTES_PER_ELEMENT;
121
+ case ComponentDatatype.UNSIGNED_BYTE:
122
+ return Uint8Array.BYTES_PER_ELEMENT;
123
+ case ComponentDatatype.SHORT:
124
+ return Int16Array.BYTES_PER_ELEMENT;
125
+ case ComponentDatatype.UNSIGNED_SHORT:
126
+ return Uint16Array.BYTES_PER_ELEMENT;
127
+ case ComponentDatatype.INT:
128
+ return Int32Array.BYTES_PER_ELEMENT;
129
+ case ComponentDatatype.UNSIGNED_INT:
130
+ return Uint32Array.BYTES_PER_ELEMENT;
131
+ case ComponentDatatype.FLOAT:
132
+ return Float32Array.BYTES_PER_ELEMENT;
133
+ case ComponentDatatype.DOUBLE:
134
+ return Float64Array.BYTES_PER_ELEMENT;
135
+ //>>includeStart('debug', pragmas.debug);
136
+ default:
137
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
138
+ }
139
+ };
140
+ ComponentDatatype.fromTypedArray = function(array) {
141
+ if (array instanceof Int8Array) {
142
+ return ComponentDatatype.BYTE;
143
+ }
144
+ if (array instanceof Uint8Array) {
145
+ return ComponentDatatype.UNSIGNED_BYTE;
146
+ }
147
+ if (array instanceof Int16Array) {
148
+ return ComponentDatatype.SHORT;
149
+ }
150
+ if (array instanceof Uint16Array) {
151
+ return ComponentDatatype.UNSIGNED_SHORT;
152
+ }
153
+ if (array instanceof Int32Array) {
154
+ return ComponentDatatype.INT;
155
+ }
156
+ if (array instanceof Uint32Array) {
157
+ return ComponentDatatype.UNSIGNED_INT;
158
+ }
159
+ if (array instanceof Float32Array) {
160
+ return ComponentDatatype.FLOAT;
161
+ }
162
+ if (array instanceof Float64Array) {
163
+ return ComponentDatatype.DOUBLE;
164
+ }
165
+ throw new DeveloperError_default(
166
+ "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
167
+ );
168
+ };
169
+ ComponentDatatype.validate = function(componentDatatype) {
170
+ 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);
171
+ };
172
+ ComponentDatatype.createTypedArray = function(componentDatatype, valuesOrLength) {
173
+ if (!defined_default(componentDatatype)) {
174
+ throw new DeveloperError_default("componentDatatype is required.");
175
+ }
176
+ if (!defined_default(valuesOrLength)) {
177
+ throw new DeveloperError_default("valuesOrLength is required.");
178
+ }
179
+ switch (componentDatatype) {
180
+ case ComponentDatatype.BYTE:
181
+ return new Int8Array(valuesOrLength);
182
+ case ComponentDatatype.UNSIGNED_BYTE:
183
+ return new Uint8Array(valuesOrLength);
184
+ case ComponentDatatype.SHORT:
185
+ return new Int16Array(valuesOrLength);
186
+ case ComponentDatatype.UNSIGNED_SHORT:
187
+ return new Uint16Array(valuesOrLength);
188
+ case ComponentDatatype.INT:
189
+ return new Int32Array(valuesOrLength);
190
+ case ComponentDatatype.UNSIGNED_INT:
191
+ return new Uint32Array(valuesOrLength);
192
+ case ComponentDatatype.FLOAT:
193
+ return new Float32Array(valuesOrLength);
194
+ case ComponentDatatype.DOUBLE:
195
+ return new Float64Array(valuesOrLength);
196
+ //>>includeStart('debug', pragmas.debug);
197
+ default:
198
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
199
+ }
200
+ };
201
+ ComponentDatatype.createArrayBufferView = function(componentDatatype, buffer, byteOffset, length) {
202
+ if (!defined_default(componentDatatype)) {
203
+ throw new DeveloperError_default("componentDatatype is required.");
204
+ }
205
+ if (!defined_default(buffer)) {
206
+ throw new DeveloperError_default("buffer is required.");
207
+ }
208
+ byteOffset = defaultValue_default(byteOffset, 0);
209
+ length = defaultValue_default(
210
+ length,
211
+ (buffer.byteLength - byteOffset) / ComponentDatatype.getSizeInBytes(componentDatatype)
212
+ );
213
+ switch (componentDatatype) {
214
+ case ComponentDatatype.BYTE:
215
+ return new Int8Array(buffer, byteOffset, length);
216
+ case ComponentDatatype.UNSIGNED_BYTE:
217
+ return new Uint8Array(buffer, byteOffset, length);
218
+ case ComponentDatatype.SHORT:
219
+ return new Int16Array(buffer, byteOffset, length);
220
+ case ComponentDatatype.UNSIGNED_SHORT:
221
+ return new Uint16Array(buffer, byteOffset, length);
222
+ case ComponentDatatype.INT:
223
+ return new Int32Array(buffer, byteOffset, length);
224
+ case ComponentDatatype.UNSIGNED_INT:
225
+ return new Uint32Array(buffer, byteOffset, length);
226
+ case ComponentDatatype.FLOAT:
227
+ return new Float32Array(buffer, byteOffset, length);
228
+ case ComponentDatatype.DOUBLE:
229
+ return new Float64Array(buffer, byteOffset, length);
230
+ //>>includeStart('debug', pragmas.debug);
231
+ default:
232
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
233
+ }
234
+ };
235
+ ComponentDatatype.fromName = function(name) {
236
+ switch (name) {
237
+ case "BYTE":
238
+ return ComponentDatatype.BYTE;
239
+ case "UNSIGNED_BYTE":
240
+ return ComponentDatatype.UNSIGNED_BYTE;
241
+ case "SHORT":
242
+ return ComponentDatatype.SHORT;
243
+ case "UNSIGNED_SHORT":
244
+ return ComponentDatatype.UNSIGNED_SHORT;
245
+ case "INT":
246
+ return ComponentDatatype.INT;
247
+ case "UNSIGNED_INT":
248
+ return ComponentDatatype.UNSIGNED_INT;
249
+ case "FLOAT":
250
+ return ComponentDatatype.FLOAT;
251
+ case "DOUBLE":
252
+ return ComponentDatatype.DOUBLE;
253
+ //>>includeStart('debug', pragmas.debug);
254
+ default:
255
+ throw new DeveloperError_default("name is not a valid value.");
256
+ }
257
+ };
258
+ var ComponentDatatype_default = Object.freeze(ComponentDatatype);
259
+
260
+ export {
261
+ ComponentDatatype_default
262
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.39
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
+ defaultValue_default
28
+ } from "./chunk-QUJ6BNQF.js";
29
+
30
+ // packages/engine/Source/Core/GeometryAttributes.js
31
+ function GeometryAttributes(options) {
32
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
33
+ this.position = options.position;
34
+ this.normal = options.normal;
35
+ this.st = options.st;
36
+ this.bitangent = options.bitangent;
37
+ this.tangent = options.tangent;
38
+ this.color = options.color;
39
+ }
40
+ var GeometryAttributes_default = GeometryAttributes;
41
+
42
+ export {
43
+ GeometryAttributes_default
44
+ };
@@ -0,0 +1,239 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.39
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
+ GeographicProjection_default
28
+ } from "./chunk-YCU6WHSN.js";
29
+ import {
30
+ Matrix2_default,
31
+ Rectangle_default
32
+ } from "./chunk-ALIDMMNJ.js";
33
+ import {
34
+ Cartesian3_default,
35
+ Cartographic_default,
36
+ Ellipsoid_default
37
+ } from "./chunk-LDXSEGOX.js";
38
+ import {
39
+ Math_default
40
+ } from "./chunk-UN3RMNI2.js";
41
+ import {
42
+ DeveloperError_default
43
+ } from "./chunk-EKUYACAZ.js";
44
+ import {
45
+ defined_default
46
+ } from "./chunk-2PWEYBYR.js";
47
+
48
+ // packages/engine/Source/Core/RectangleGeometryLibrary.js
49
+ var cos = Math.cos;
50
+ var sin = Math.sin;
51
+ var sqrt = Math.sqrt;
52
+ var RectangleGeometryLibrary = {};
53
+ RectangleGeometryLibrary.computePosition = function(computedOptions, ellipsoid, computeST, row, col, position, st) {
54
+ const radiiSquared = ellipsoid.radiiSquared;
55
+ const nwCorner = computedOptions.nwCorner;
56
+ const rectangle = computedOptions.boundingRectangle;
57
+ let stLatitude = nwCorner.latitude - computedOptions.granYCos * row + col * computedOptions.granXSin;
58
+ const cosLatitude = cos(stLatitude);
59
+ const nZ = sin(stLatitude);
60
+ const kZ = radiiSquared.z * nZ;
61
+ let stLongitude = nwCorner.longitude + row * computedOptions.granYSin + col * computedOptions.granXCos;
62
+ const nX = cosLatitude * cos(stLongitude);
63
+ const nY = cosLatitude * sin(stLongitude);
64
+ const kX = radiiSquared.x * nX;
65
+ const kY = radiiSquared.y * nY;
66
+ const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
67
+ position.x = kX / gamma;
68
+ position.y = kY / gamma;
69
+ position.z = kZ / gamma;
70
+ if (computeST) {
71
+ const stNwCorner = computedOptions.stNwCorner;
72
+ if (defined_default(stNwCorner)) {
73
+ stLatitude = stNwCorner.latitude - computedOptions.stGranYCos * row + col * computedOptions.stGranXSin;
74
+ stLongitude = stNwCorner.longitude + row * computedOptions.stGranYSin + col * computedOptions.stGranXCos;
75
+ st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
76
+ st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
77
+ } else {
78
+ st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
79
+ st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
80
+ }
81
+ }
82
+ };
83
+ var rotationMatrixScratch = new Matrix2_default();
84
+ var nwCartesian = new Cartesian3_default();
85
+ var centerScratch = new Cartographic_default();
86
+ var centerCartesian = new Cartesian3_default();
87
+ var proj = new GeographicProjection_default();
88
+ function getRotationOptions(nwCorner, rotation, granularityX, granularityY, center, width, height) {
89
+ const cosRotation = Math.cos(rotation);
90
+ const granYCos = granularityY * cosRotation;
91
+ const granXCos = granularityX * cosRotation;
92
+ const sinRotation = Math.sin(rotation);
93
+ const granYSin = granularityY * sinRotation;
94
+ const granXSin = granularityX * sinRotation;
95
+ proj._ellipsoid = Ellipsoid_default.default;
96
+ nwCartesian = proj.project(nwCorner, nwCartesian);
97
+ nwCartesian = Cartesian3_default.subtract(nwCartesian, centerCartesian, nwCartesian);
98
+ const rotationMatrix = Matrix2_default.fromRotation(rotation, rotationMatrixScratch);
99
+ nwCartesian = Matrix2_default.multiplyByVector(
100
+ rotationMatrix,
101
+ nwCartesian,
102
+ nwCartesian
103
+ );
104
+ nwCartesian = Cartesian3_default.add(nwCartesian, centerCartesian, nwCartesian);
105
+ nwCorner = proj.unproject(nwCartesian, nwCorner);
106
+ width -= 1;
107
+ height -= 1;
108
+ const latitude = nwCorner.latitude;
109
+ const latitude0 = latitude + width * granXSin;
110
+ const latitude1 = latitude - granYCos * height;
111
+ const latitude2 = latitude - granYCos * height + width * granXSin;
112
+ const north = Math.max(latitude, latitude0, latitude1, latitude2);
113
+ const south = Math.min(latitude, latitude0, latitude1, latitude2);
114
+ const longitude = nwCorner.longitude;
115
+ const longitude0 = longitude + width * granXCos;
116
+ const longitude1 = longitude + height * granYSin;
117
+ const longitude2 = longitude + height * granYSin + width * granXCos;
118
+ const east = Math.max(longitude, longitude0, longitude1, longitude2);
119
+ const west = Math.min(longitude, longitude0, longitude1, longitude2);
120
+ return {
121
+ north,
122
+ south,
123
+ east,
124
+ west,
125
+ granYCos,
126
+ granYSin,
127
+ granXCos,
128
+ granXSin,
129
+ nwCorner
130
+ };
131
+ }
132
+ RectangleGeometryLibrary.computeOptions = function(rectangle, granularity, rotation, stRotation, boundingRectangleScratch, nwCornerResult, stNwCornerResult) {
133
+ let east = rectangle.east;
134
+ let west = rectangle.west;
135
+ let north = rectangle.north;
136
+ let south = rectangle.south;
137
+ let northCap = false;
138
+ let southCap = false;
139
+ if (north === Math_default.PI_OVER_TWO) {
140
+ northCap = true;
141
+ }
142
+ if (south === -Math_default.PI_OVER_TWO) {
143
+ southCap = true;
144
+ }
145
+ let dx;
146
+ const dy = north - south;
147
+ if (west > east) {
148
+ dx = Math_default.TWO_PI - west + east;
149
+ } else {
150
+ dx = east - west;
151
+ }
152
+ const width = Math.ceil(dx / granularity) + 1;
153
+ const height = Math.ceil(dy / granularity) + 1;
154
+ const granularityX = dx / (width - 1);
155
+ const granularityY = dy / (height - 1);
156
+ const nwCorner = Rectangle_default.northwest(rectangle, nwCornerResult);
157
+ const center = Rectangle_default.center(rectangle, centerScratch);
158
+ if (rotation !== 0 || stRotation !== 0) {
159
+ if (center.longitude < nwCorner.longitude) {
160
+ center.longitude += Math_default.TWO_PI;
161
+ }
162
+ proj._ellipsoid = Ellipsoid_default.default;
163
+ centerCartesian = proj.project(center, centerCartesian);
164
+ }
165
+ const granYCos = granularityY;
166
+ const granXCos = granularityX;
167
+ const granYSin = 0;
168
+ const granXSin = 0;
169
+ const boundingRectangle = Rectangle_default.clone(
170
+ rectangle,
171
+ boundingRectangleScratch
172
+ );
173
+ const computedOptions = {
174
+ granYCos,
175
+ granYSin,
176
+ granXCos,
177
+ granXSin,
178
+ nwCorner,
179
+ boundingRectangle,
180
+ width,
181
+ height,
182
+ northCap,
183
+ southCap
184
+ };
185
+ if (rotation !== 0) {
186
+ const rotationOptions = getRotationOptions(
187
+ nwCorner,
188
+ rotation,
189
+ granularityX,
190
+ granularityY,
191
+ center,
192
+ width,
193
+ height
194
+ );
195
+ north = rotationOptions.north;
196
+ south = rotationOptions.south;
197
+ east = rotationOptions.east;
198
+ west = rotationOptions.west;
199
+ if (north < -Math_default.PI_OVER_TWO || north > Math_default.PI_OVER_TWO || south < -Math_default.PI_OVER_TWO || south > Math_default.PI_OVER_TWO) {
200
+ throw new DeveloperError_default(
201
+ "Rotated rectangle is invalid. It crosses over either the north or south pole."
202
+ );
203
+ }
204
+ computedOptions.granYCos = rotationOptions.granYCos;
205
+ computedOptions.granYSin = rotationOptions.granYSin;
206
+ computedOptions.granXCos = rotationOptions.granXCos;
207
+ computedOptions.granXSin = rotationOptions.granXSin;
208
+ boundingRectangle.north = north;
209
+ boundingRectangle.south = south;
210
+ boundingRectangle.east = east;
211
+ boundingRectangle.west = west;
212
+ }
213
+ if (stRotation !== 0) {
214
+ rotation = rotation - stRotation;
215
+ const stNwCorner = Rectangle_default.northwest(boundingRectangle, stNwCornerResult);
216
+ const stRotationOptions = getRotationOptions(
217
+ stNwCorner,
218
+ rotation,
219
+ granularityX,
220
+ granularityY,
221
+ center,
222
+ width,
223
+ height
224
+ );
225
+ computedOptions.stGranYCos = stRotationOptions.granYCos;
226
+ computedOptions.stGranXCos = stRotationOptions.granXCos;
227
+ computedOptions.stGranYSin = stRotationOptions.granYSin;
228
+ computedOptions.stGranXSin = stRotationOptions.granXSin;
229
+ computedOptions.stNwCorner = stNwCorner;
230
+ computedOptions.stWest = stRotationOptions.west;
231
+ computedOptions.stSouth = stRotationOptions.south;
232
+ }
233
+ return computedOptions;
234
+ };
235
+ var RectangleGeometryLibrary_default = RectangleGeometryLibrary;
236
+
237
+ export {
238
+ RectangleGeometryLibrary_default
239
+ };