@hztxi/cesium-engine 25.0.2 → 25.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 (227) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +761 -520
  2. package/Build/Workers/chunk-2KZP32NE.js +3201 -0
  3. package/Build/Workers/chunk-2P5SGQUU.js +44 -0
  4. package/Build/Workers/chunk-2PFSIZOR.js +959 -0
  5. package/Build/Workers/chunk-2RC5GQMH.js +82 -0
  6. package/Build/Workers/chunk-2TM5FET3.js +241 -0
  7. package/Build/Workers/chunk-2ZYMQXBB.js +519 -0
  8. package/Build/Workers/chunk-37IVAHRF.js +3201 -0
  9. package/Build/Workers/chunk-3CSWK42O.js +3648 -0
  10. package/Build/Workers/chunk-3GDVUAIX.js +1287 -0
  11. package/Build/Workers/chunk-3L5NZHVW.js +288 -0
  12. package/Build/Workers/chunk-3LQDIJFX.js +2719 -0
  13. package/Build/Workers/chunk-3WIDW5QO.js +1800 -0
  14. package/Build/Workers/chunk-4L4ZXXL7.js +57 -0
  15. package/Build/Workers/chunk-4QK5RZ5I.js +171 -0
  16. package/Build/Workers/chunk-4RWSLDVO.js +198 -0
  17. package/Build/Workers/chunk-53HFLKT5.js +76 -0
  18. package/Build/Workers/chunk-5DJBLQEH.js +56 -0
  19. package/Build/Workers/chunk-5FNZGB4U.js +368 -0
  20. package/Build/Workers/chunk-5KOCUIKQ.js +476 -0
  21. package/Build/Workers/chunk-5PK42ITB.js +219 -0
  22. package/Build/Workers/chunk-5SGB3BKM.js +73 -0
  23. package/Build/Workers/chunk-5ZWRS2E6.js +280 -0
  24. package/Build/Workers/chunk-6FU5LWYG.js +352 -0
  25. package/Build/Workers/chunk-6IYEGXEW.js +1344 -0
  26. package/Build/Workers/chunk-6KWWDFT4.js +278 -0
  27. package/Build/Workers/chunk-73DJHI53.js +398 -0
  28. package/Build/Workers/chunk-73OT3YBQ.js +1054 -0
  29. package/Build/Workers/chunk-73T2E2OA.js +454 -0
  30. package/Build/Workers/chunk-752QDGCS.js +778 -0
  31. package/Build/Workers/chunk-76HD3HYN.js +2342 -0
  32. package/Build/Workers/chunk-7I4AKIEV.js +58 -0
  33. package/Build/Workers/chunk-7ZYD7GL6.js +414 -0
  34. package/Build/Workers/chunk-ALJYMECF.js +973 -0
  35. package/Build/Workers/chunk-ANGZAKVP.js +257 -0
  36. package/Build/Workers/chunk-ATT5UEK6.js +97 -0
  37. package/Build/Workers/chunk-AW3UT5RP.js +97 -0
  38. package/Build/Workers/chunk-AZGPL6BR.js +38 -0
  39. package/Build/Workers/chunk-B7SMDRPA.js +476 -0
  40. package/Build/Workers/chunk-BADQ2G5E.js +837 -0
  41. package/Build/Workers/chunk-BAPOWX62.js +368 -0
  42. package/Build/Workers/chunk-BE5ULV4I.js +1800 -0
  43. package/Build/Workers/chunk-BII4UB3C.js +476 -0
  44. package/Build/Workers/chunk-BPL3HT2R.js +837 -0
  45. package/Build/Workers/chunk-BVAMP4M3.js +101 -0
  46. package/Build/Workers/chunk-BVFS5LSK.js +1067 -0
  47. package/Build/Workers/chunk-CKWUU4JK.js +138 -0
  48. package/Build/Workers/chunk-CMMHWVUF.js +2719 -0
  49. package/Build/Workers/chunk-CQNFIAZU.js +56 -0
  50. package/Build/Workers/chunk-CSUBL77L.js +140 -0
  51. package/Build/Workers/chunk-DHCQSFRN.js +301 -0
  52. package/Build/Workers/chunk-DKFSOFKR.js +241 -0
  53. package/Build/Workers/chunk-DLHFYNG6.js +52 -0
  54. package/Build/Workers/chunk-ETABYWY4.js +973 -0
  55. package/Build/Workers/chunk-EYVCQUVQ.js +1067 -0
  56. package/Build/Workers/chunk-FE7VHPNW.js +102 -0
  57. package/Build/Workers/chunk-FFEVCOBU.js +387 -0
  58. package/Build/Workers/chunk-FWABE4BL.js +305 -0
  59. package/Build/Workers/chunk-GC24BPCQ.js +305 -0
  60. package/Build/Workers/chunk-GCTHMF35.js +387 -0
  61. package/Build/Workers/chunk-GDHSPLWC.js +9237 -0
  62. package/Build/Workers/chunk-GGK7SA4Y.js +414 -0
  63. package/Build/Workers/chunk-GGVG7G5Z.js +1483 -0
  64. package/Build/Workers/chunk-GL7W3I3A.js +959 -0
  65. package/Build/Workers/chunk-H52M4HMP.js +9230 -0
  66. package/Build/Workers/chunk-H7QGY7HB.js +1054 -0
  67. package/Build/Workers/chunk-H7ZXQIV2.js +398 -0
  68. package/Build/Workers/chunk-HBJKIDKK.js +76 -0
  69. package/Build/Workers/chunk-HERVRBJW.js +76 -0
  70. package/Build/Workers/chunk-HFMS7MXO.js +511 -0
  71. package/Build/Workers/chunk-HH6PJ22V.js +455 -0
  72. package/Build/Workers/chunk-HQ2PXPP7.js +102 -0
  73. package/Build/Workers/chunk-HTO45L3X.js +454 -0
  74. package/Build/Workers/chunk-HW5TLMPQ.js +57 -0
  75. package/Build/Workers/chunk-IC3HVJBG.js +301 -0
  76. package/Build/Workers/chunk-IEKP7CEH.js +387 -0
  77. package/Build/Workers/chunk-ILUFUAF3.js +1992 -0
  78. package/Build/Workers/chunk-ILX5N5QR.js +2342 -0
  79. package/Build/Workers/chunk-IRSD4EJW.js +630 -0
  80. package/Build/Workers/chunk-J3A3XMTG.js +672 -0
  81. package/Build/Workers/chunk-JK54NBBO.js +778 -0
  82. package/Build/Workers/chunk-JSFKPEFK.js +352 -0
  83. package/Build/Workers/chunk-JTSSQ3RH.js +147 -0
  84. package/Build/Workers/chunk-JZVZDHC2.js +288 -0
  85. package/Build/Workers/chunk-K724BR5O.js +455 -0
  86. package/Build/Workers/chunk-KJOVSN7J.js +56 -0
  87. package/Build/Workers/chunk-KKEMKV5G.js +44 -0
  88. package/Build/Workers/chunk-KXNXQXP5.js +682 -0
  89. package/Build/Workers/chunk-KYXZ3XTC.js +497 -0
  90. package/Build/Workers/chunk-L65LWRUE.js +3648 -0
  91. package/Build/Workers/chunk-LAN4XQR6.js +162 -0
  92. package/Build/Workers/chunk-LVO4J36T.js +1800 -0
  93. package/Build/Workers/chunk-LY5KUQ2L.js +57 -0
  94. package/Build/Workers/chunk-M2XWG5VC.js +124 -0
  95. package/Build/Workers/chunk-MUPWJMPP.js +44 -0
  96. package/Build/Workers/chunk-MVBEMXN4.js +163 -0
  97. package/Build/Workers/chunk-MVQYVX6D.js +511 -0
  98. package/Build/Workers/chunk-N4RF6TUL.js +301 -0
  99. package/Build/Workers/chunk-NCH4P66E.js +219 -0
  100. package/Build/Workers/chunk-NCL22ZUX.js +56 -0
  101. package/Build/Workers/chunk-NNJDVVEG.js +3794 -0
  102. package/Build/Workers/chunk-NYQSZLRF.js +78 -0
  103. package/Build/Workers/chunk-O2V4I3I5.js +682 -0
  104. package/Build/Workers/chunk-O453S45W.js +1483 -0
  105. package/Build/Workers/chunk-O5CYW2IR.js +1046 -0
  106. package/Build/Workers/chunk-OJ7O7DKV.js +973 -0
  107. package/Build/Workers/chunk-OJK33YVT.js +171 -0
  108. package/Build/Workers/chunk-OKFC4PDV.js +1344 -0
  109. package/Build/Workers/chunk-OKUXJIW3.js +124 -0
  110. package/Build/Workers/chunk-OWDZ5BX4.js +280 -0
  111. package/Build/Workers/chunk-PCERHV4S.js +198 -0
  112. package/Build/Workers/chunk-PJT22BD4.js +352 -0
  113. package/Build/Workers/chunk-PKV3R77E.js +672 -0
  114. package/Build/Workers/chunk-PQ2MGY7X.js +162 -0
  115. package/Build/Workers/chunk-PR62UBKE.js +693 -0
  116. package/Build/Workers/chunk-QJJ3GXSH.js +140 -0
  117. package/Build/Workers/chunk-QM4HZZYW.js +219 -0
  118. package/Build/Workers/chunk-QQ2BBL7Z.js +162 -0
  119. package/Build/Workers/chunk-QYC6Y25A.js +124 -0
  120. package/Build/Workers/chunk-RBAZR7R2.js +280 -0
  121. package/Build/Workers/chunk-REZJEC6F.js +241 -0
  122. package/Build/Workers/chunk-RS3LRHOK.js +73 -0
  123. package/Build/Workers/chunk-S2WTOFGB.js +102 -0
  124. package/Build/Workers/chunk-SGLJWWWY.js +352 -0
  125. package/Build/Workers/chunk-SJZMU3OS.js +2342 -0
  126. package/Build/Workers/chunk-SMZXVFCA.js +1344 -0
  127. package/Build/Workers/chunk-SND4KNB6.js +754 -0
  128. package/Build/Workers/chunk-SRH2XIWS.js +1067 -0
  129. package/Build/Workers/chunk-SXSP3JHS.js +38 -0
  130. package/Build/Workers/chunk-T6SVKD76.js +511 -0
  131. package/Build/Workers/chunk-TA3PH4Q7.js +519 -0
  132. package/Build/Workers/chunk-TDJ2NSYJ.js +171 -0
  133. package/Build/Workers/chunk-TJCD5NV5.js +837 -0
  134. package/Build/Workers/chunk-TXBADNRA.js +9237 -0
  135. package/Build/Workers/chunk-TYW2D7VU.js +2719 -0
  136. package/Build/Workers/chunk-U3KB4HMG.js +1054 -0
  137. package/Build/Workers/chunk-U6OMVSBY.js +368 -0
  138. package/Build/Workers/chunk-UAVMVBMC.js +754 -0
  139. package/Build/Workers/chunk-UCOZLNHF.js +1284 -0
  140. package/Build/Workers/chunk-UDKEO3UF.js +163 -0
  141. package/Build/Workers/chunk-UIQUUY4A.js +73 -0
  142. package/Build/Workers/chunk-ULY2FDDP.js +454 -0
  143. package/Build/Workers/chunk-UT7YX565.js +1992 -0
  144. package/Build/Workers/chunk-UTOYFI3Q.js +1992 -0
  145. package/Build/Workers/chunk-UUXWWJI7.js +101 -0
  146. package/Build/Workers/chunk-V5AWAGL2.js +97 -0
  147. package/Build/Workers/chunk-V5AXOGPW.js +682 -0
  148. package/Build/Workers/chunk-VAUX2Q2X.js +138 -0
  149. package/Build/Workers/chunk-VDX4SJKV.js +58 -0
  150. package/Build/Workers/chunk-W7WEPLZL.js +414 -0
  151. package/Build/Workers/chunk-WNAG4FHY.js +305 -0
  152. package/Build/Workers/chunk-WNQX2CP3.js +455 -0
  153. package/Build/Workers/chunk-XCASHPVG.js +778 -0
  154. package/Build/Workers/chunk-XJUIVTHG.js +1483 -0
  155. package/Build/Workers/chunk-XQVSSVT2.js +140 -0
  156. package/Build/Workers/chunk-Y5E2LVSX.js +138 -0
  157. package/Build/Workers/chunk-YEMKJOOG.js +352 -0
  158. package/Build/Workers/chunk-YGFVAGYF.js +630 -0
  159. package/Build/Workers/chunk-YNWTO2WN.js +147 -0
  160. package/Build/Workers/chunk-YZAMLSIA.js +352 -0
  161. package/Build/Workers/chunk-Z6LUW5FN.js +198 -0
  162. package/Build/Workers/chunk-ZDUCDVKX.js +288 -0
  163. package/Build/Workers/chunk-ZEEPTE4R.js +147 -0
  164. package/Build/Workers/chunk-ZIBW2BFB.js +1284 -0
  165. package/Build/Workers/chunk-ZOYVNCFZ.js +754 -0
  166. package/Build/Workers/chunk-ZSWY7UNG.js +3201 -0
  167. package/Build/Workers/chunk-ZXRWKKJP.js +398 -0
  168. package/Build/Workers/combineGeometry.js +24 -24
  169. package/Build/Workers/createBoxGeometry.js +18 -18
  170. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  171. package/Build/Workers/createCircleGeometry.js +26 -26
  172. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  173. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  174. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  175. package/Build/Workers/createCorridorGeometry.js +29 -29
  176. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  177. package/Build/Workers/createCylinderGeometry.js +20 -20
  178. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  179. package/Build/Workers/createEllipseGeometry.js +26 -26
  180. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  181. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  182. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  183. package/Build/Workers/createFrustumGeometry.js +18 -18
  184. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  185. package/Build/Workers/createGeometry.js +24 -24
  186. package/Build/Workers/createGroundPolylineGeometry.js +23 -23
  187. package/Build/Workers/createMvtTile.js +1815 -0
  188. package/Build/Workers/createPlaneGeometry.js +16 -16
  189. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  190. package/Build/Workers/createPolygonGeometry.js +32 -32
  191. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  192. package/Build/Workers/createPolylineGeometry.js +25 -25
  193. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  194. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  195. package/Build/Workers/createRectangleGeometry.js +27 -27
  196. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  197. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  198. package/Build/Workers/createSphereGeometry.js +19 -19
  199. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  200. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  201. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  202. package/Build/Workers/createVectorTileGeometries.js +24 -24
  203. package/Build/Workers/createVectorTilePoints.js +13 -13
  204. package/Build/Workers/createVectorTilePolygons.js +22 -22
  205. package/Build/Workers/createVectorTilePolylines.js +14 -14
  206. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
  207. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
  208. package/Build/Workers/createVerticesFromHeightmap.js +25 -25
  209. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
  210. package/Build/Workers/createWallGeometry.js +24 -24
  211. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  212. package/Build/Workers/decodeDraco.js +10 -10
  213. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +58 -44
  214. package/Build/Workers/decodeI3S.js +10 -10
  215. package/Build/Workers/gaussianSplatSorter.js +4 -4
  216. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  217. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  218. package/Build/Workers/transcodeKTX2.js +7 -7
  219. package/Build/Workers/transferTypedArrayTest.js +1 -1
  220. package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
  221. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
  222. package/Source/Core/ScreenSpaceEventHandler.js +19 -0
  223. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  224. package/Source/ThirdParty/zip-module.wasm +0 -0
  225. package/index.d.ts +48305 -0
  226. package/index.js +373 -373
  227. package/package.json +10 -10
@@ -0,0 +1,278 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.144.0
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-YGFVAGYF.js";
29
+ import {
30
+ DeveloperError_default
31
+ } from "./chunk-UDKEO3UF.js";
32
+ import {
33
+ defined_default
34
+ } from "./chunk-NYQSZLRF.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,398 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.144.0
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
+ CylinderGeometryLibrary_default
28
+ } from "./chunk-5SGB3BKM.js";
29
+ import {
30
+ GeometryOffsetAttribute_default
31
+ } from "./chunk-SXSP3JHS.js";
32
+ import {
33
+ VertexFormat_default
34
+ } from "./chunk-VAUX2Q2X.js";
35
+ import {
36
+ IndexDatatype_default
37
+ } from "./chunk-CSUBL77L.js";
38
+ import {
39
+ GeometryAttributes_default
40
+ } from "./chunk-KKEMKV5G.js";
41
+ import {
42
+ BoundingSphere_default
43
+ } from "./chunk-ZIBW2BFB.js";
44
+ import {
45
+ GeometryAttribute_default,
46
+ Geometry_default,
47
+ PrimitiveType_default
48
+ } from "./chunk-N4RF6TUL.js";
49
+ import {
50
+ ComponentDatatype_default
51
+ } from "./chunk-6KWWDFT4.js";
52
+ import {
53
+ Cartesian2_default
54
+ } from "./chunk-UTOYFI3Q.js";
55
+ import {
56
+ Cartesian3_default,
57
+ Frozen_default
58
+ } from "./chunk-SJZMU3OS.js";
59
+ import {
60
+ Math_default
61
+ } from "./chunk-2ZYMQXBB.js";
62
+ import {
63
+ DeveloperError_default
64
+ } from "./chunk-UDKEO3UF.js";
65
+ import {
66
+ defined_default
67
+ } from "./chunk-NYQSZLRF.js";
68
+
69
+ // packages/engine/Source/Core/CylinderGeometry.js
70
+ var radiusScratch = new Cartesian2_default();
71
+ var normalScratch = new Cartesian3_default();
72
+ var bitangentScratch = new Cartesian3_default();
73
+ var tangentScratch = new Cartesian3_default();
74
+ var positionScratch = new Cartesian3_default();
75
+ function CylinderGeometry(options) {
76
+ options = options ?? Frozen_default.EMPTY_OBJECT;
77
+ const length = options.length;
78
+ const topRadius = options.topRadius;
79
+ const bottomRadius = options.bottomRadius;
80
+ const vertexFormat = options.vertexFormat ?? VertexFormat_default.DEFAULT;
81
+ const slices = options.slices ?? 128;
82
+ if (!defined_default(length)) {
83
+ throw new DeveloperError_default("options.length must be defined.");
84
+ }
85
+ if (!defined_default(topRadius)) {
86
+ throw new DeveloperError_default("options.topRadius must be defined.");
87
+ }
88
+ if (!defined_default(bottomRadius)) {
89
+ throw new DeveloperError_default("options.bottomRadius must be defined.");
90
+ }
91
+ if (slices < 3) {
92
+ throw new DeveloperError_default(
93
+ "options.slices must be greater than or equal to 3."
94
+ );
95
+ }
96
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
97
+ throw new DeveloperError_default(
98
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
99
+ );
100
+ }
101
+ this._length = length;
102
+ this._topRadius = topRadius;
103
+ this._bottomRadius = bottomRadius;
104
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
105
+ this._slices = slices;
106
+ this._offsetAttribute = options.offsetAttribute;
107
+ this._workerName = "createCylinderGeometry";
108
+ }
109
+ CylinderGeometry.packedLength = VertexFormat_default.packedLength + 5;
110
+ CylinderGeometry.pack = function(value, array, startingIndex) {
111
+ if (!defined_default(value)) {
112
+ throw new DeveloperError_default("value is required");
113
+ }
114
+ if (!defined_default(array)) {
115
+ throw new DeveloperError_default("array is required");
116
+ }
117
+ startingIndex = startingIndex ?? 0;
118
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
119
+ startingIndex += VertexFormat_default.packedLength;
120
+ array[startingIndex++] = value._length;
121
+ array[startingIndex++] = value._topRadius;
122
+ array[startingIndex++] = value._bottomRadius;
123
+ array[startingIndex++] = value._slices;
124
+ array[startingIndex] = value._offsetAttribute ?? -1;
125
+ return array;
126
+ };
127
+ var scratchVertexFormat = new VertexFormat_default();
128
+ var scratchOptions = {
129
+ vertexFormat: scratchVertexFormat,
130
+ length: void 0,
131
+ topRadius: void 0,
132
+ bottomRadius: void 0,
133
+ slices: void 0,
134
+ offsetAttribute: void 0
135
+ };
136
+ CylinderGeometry.unpack = function(array, startingIndex, result) {
137
+ if (!defined_default(array)) {
138
+ throw new DeveloperError_default("array is required");
139
+ }
140
+ startingIndex = startingIndex ?? 0;
141
+ const vertexFormat = VertexFormat_default.unpack(
142
+ array,
143
+ startingIndex,
144
+ scratchVertexFormat
145
+ );
146
+ startingIndex += VertexFormat_default.packedLength;
147
+ const length = array[startingIndex++];
148
+ const topRadius = array[startingIndex++];
149
+ const bottomRadius = array[startingIndex++];
150
+ const slices = array[startingIndex++];
151
+ const offsetAttribute = array[startingIndex];
152
+ if (!defined_default(result)) {
153
+ scratchOptions.length = length;
154
+ scratchOptions.topRadius = topRadius;
155
+ scratchOptions.bottomRadius = bottomRadius;
156
+ scratchOptions.slices = slices;
157
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
158
+ return new CylinderGeometry(scratchOptions);
159
+ }
160
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
161
+ result._length = length;
162
+ result._topRadius = topRadius;
163
+ result._bottomRadius = bottomRadius;
164
+ result._slices = slices;
165
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
166
+ return result;
167
+ };
168
+ CylinderGeometry.createGeometry = function(cylinderGeometry) {
169
+ let length = cylinderGeometry._length;
170
+ const topRadius = cylinderGeometry._topRadius;
171
+ const bottomRadius = cylinderGeometry._bottomRadius;
172
+ const vertexFormat = cylinderGeometry._vertexFormat;
173
+ const slices = cylinderGeometry._slices;
174
+ if (length <= 0 || topRadius < 0 || bottomRadius < 0 || topRadius === 0 && bottomRadius === 0) {
175
+ return;
176
+ }
177
+ const twoSlices = slices + slices;
178
+ const threeSlices = slices + twoSlices;
179
+ const numVertices = twoSlices + twoSlices;
180
+ const positions = CylinderGeometryLibrary_default.computePositions(
181
+ length,
182
+ topRadius,
183
+ bottomRadius,
184
+ slices,
185
+ true
186
+ );
187
+ const st = vertexFormat.st ? new Float32Array(numVertices * 2) : void 0;
188
+ const normals = vertexFormat.normal ? new Float32Array(numVertices * 3) : void 0;
189
+ const tangents = vertexFormat.tangent ? new Float32Array(numVertices * 3) : void 0;
190
+ const bitangents = vertexFormat.bitangent ? new Float32Array(numVertices * 3) : void 0;
191
+ let i;
192
+ const computeNormal = vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;
193
+ if (computeNormal) {
194
+ const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;
195
+ let normalIndex = 0;
196
+ let tangentIndex = 0;
197
+ let bitangentIndex = 0;
198
+ const theta = Math.atan2(bottomRadius - topRadius, length);
199
+ const normal = normalScratch;
200
+ normal.z = Math.sin(theta);
201
+ const normalScale = Math.cos(theta);
202
+ let tangent = tangentScratch;
203
+ let bitangent = bitangentScratch;
204
+ for (i = 0; i < slices; i++) {
205
+ const angle = i / slices * Math_default.TWO_PI;
206
+ const x = normalScale * Math.cos(angle);
207
+ const y = normalScale * Math.sin(angle);
208
+ if (computeNormal) {
209
+ normal.x = x;
210
+ normal.y = y;
211
+ if (computeTangent) {
212
+ tangent = Cartesian3_default.normalize(
213
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent),
214
+ tangent
215
+ );
216
+ }
217
+ if (vertexFormat.normal) {
218
+ normals[normalIndex++] = normal.x;
219
+ normals[normalIndex++] = normal.y;
220
+ normals[normalIndex++] = normal.z;
221
+ normals[normalIndex++] = normal.x;
222
+ normals[normalIndex++] = normal.y;
223
+ normals[normalIndex++] = normal.z;
224
+ }
225
+ if (vertexFormat.tangent) {
226
+ tangents[tangentIndex++] = tangent.x;
227
+ tangents[tangentIndex++] = tangent.y;
228
+ tangents[tangentIndex++] = tangent.z;
229
+ tangents[tangentIndex++] = tangent.x;
230
+ tangents[tangentIndex++] = tangent.y;
231
+ tangents[tangentIndex++] = tangent.z;
232
+ }
233
+ if (vertexFormat.bitangent) {
234
+ bitangent = Cartesian3_default.normalize(
235
+ Cartesian3_default.cross(normal, tangent, bitangent),
236
+ bitangent
237
+ );
238
+ bitangents[bitangentIndex++] = bitangent.x;
239
+ bitangents[bitangentIndex++] = bitangent.y;
240
+ bitangents[bitangentIndex++] = bitangent.z;
241
+ bitangents[bitangentIndex++] = bitangent.x;
242
+ bitangents[bitangentIndex++] = bitangent.y;
243
+ bitangents[bitangentIndex++] = bitangent.z;
244
+ }
245
+ }
246
+ }
247
+ for (i = 0; i < slices; i++) {
248
+ if (vertexFormat.normal) {
249
+ normals[normalIndex++] = 0;
250
+ normals[normalIndex++] = 0;
251
+ normals[normalIndex++] = -1;
252
+ }
253
+ if (vertexFormat.tangent) {
254
+ tangents[tangentIndex++] = 1;
255
+ tangents[tangentIndex++] = 0;
256
+ tangents[tangentIndex++] = 0;
257
+ }
258
+ if (vertexFormat.bitangent) {
259
+ bitangents[bitangentIndex++] = 0;
260
+ bitangents[bitangentIndex++] = -1;
261
+ bitangents[bitangentIndex++] = 0;
262
+ }
263
+ }
264
+ for (i = 0; i < slices; i++) {
265
+ if (vertexFormat.normal) {
266
+ normals[normalIndex++] = 0;
267
+ normals[normalIndex++] = 0;
268
+ normals[normalIndex++] = 1;
269
+ }
270
+ if (vertexFormat.tangent) {
271
+ tangents[tangentIndex++] = 1;
272
+ tangents[tangentIndex++] = 0;
273
+ tangents[tangentIndex++] = 0;
274
+ }
275
+ if (vertexFormat.bitangent) {
276
+ bitangents[bitangentIndex++] = 0;
277
+ bitangents[bitangentIndex++] = 1;
278
+ bitangents[bitangentIndex++] = 0;
279
+ }
280
+ }
281
+ }
282
+ const numIndices = 12 * slices - 12;
283
+ const indices = IndexDatatype_default.createTypedArray(numVertices, numIndices);
284
+ let index = 0;
285
+ let j = 0;
286
+ for (i = 0; i < slices - 1; i++) {
287
+ indices[index++] = j;
288
+ indices[index++] = j + 2;
289
+ indices[index++] = j + 3;
290
+ indices[index++] = j;
291
+ indices[index++] = j + 3;
292
+ indices[index++] = j + 1;
293
+ j += 2;
294
+ }
295
+ indices[index++] = twoSlices - 2;
296
+ indices[index++] = 0;
297
+ indices[index++] = 1;
298
+ indices[index++] = twoSlices - 2;
299
+ indices[index++] = 1;
300
+ indices[index++] = twoSlices - 1;
301
+ for (i = 1; i < slices - 1; i++) {
302
+ indices[index++] = twoSlices + i + 1;
303
+ indices[index++] = twoSlices + i;
304
+ indices[index++] = twoSlices;
305
+ }
306
+ for (i = 1; i < slices - 1; i++) {
307
+ indices[index++] = threeSlices;
308
+ indices[index++] = threeSlices + i;
309
+ indices[index++] = threeSlices + i + 1;
310
+ }
311
+ let textureCoordIndex = 0;
312
+ if (vertexFormat.st) {
313
+ const rad = Math.max(topRadius, bottomRadius);
314
+ for (i = 0; i < numVertices; i++) {
315
+ const position = Cartesian3_default.fromArray(positions, i * 3, positionScratch);
316
+ st[textureCoordIndex++] = (position.x + rad) / (2 * rad);
317
+ st[textureCoordIndex++] = (position.y + rad) / (2 * rad);
318
+ }
319
+ }
320
+ const attributes = new GeometryAttributes_default();
321
+ if (vertexFormat.position) {
322
+ attributes.position = new GeometryAttribute_default({
323
+ componentDatatype: ComponentDatatype_default.DOUBLE,
324
+ componentsPerAttribute: 3,
325
+ values: positions
326
+ });
327
+ }
328
+ if (vertexFormat.normal) {
329
+ attributes.normal = new GeometryAttribute_default({
330
+ componentDatatype: ComponentDatatype_default.FLOAT,
331
+ componentsPerAttribute: 3,
332
+ values: normals
333
+ });
334
+ }
335
+ if (vertexFormat.tangent) {
336
+ attributes.tangent = new GeometryAttribute_default({
337
+ componentDatatype: ComponentDatatype_default.FLOAT,
338
+ componentsPerAttribute: 3,
339
+ values: tangents
340
+ });
341
+ }
342
+ if (vertexFormat.bitangent) {
343
+ attributes.bitangent = new GeometryAttribute_default({
344
+ componentDatatype: ComponentDatatype_default.FLOAT,
345
+ componentsPerAttribute: 3,
346
+ values: bitangents
347
+ });
348
+ }
349
+ if (vertexFormat.st) {
350
+ attributes.st = new GeometryAttribute_default({
351
+ componentDatatype: ComponentDatatype_default.FLOAT,
352
+ componentsPerAttribute: 2,
353
+ values: st
354
+ });
355
+ }
356
+ radiusScratch.x = length * 0.5;
357
+ radiusScratch.y = Math.max(bottomRadius, topRadius);
358
+ const boundingSphere = new BoundingSphere_default(
359
+ Cartesian3_default.ZERO,
360
+ Cartesian2_default.magnitude(radiusScratch)
361
+ );
362
+ if (defined_default(cylinderGeometry._offsetAttribute)) {
363
+ length = positions.length;
364
+ const offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
365
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
366
+ attributes.applyOffset = new GeometryAttribute_default({
367
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
368
+ componentsPerAttribute: 1,
369
+ values: applyOffset
370
+ });
371
+ }
372
+ return new Geometry_default({
373
+ attributes,
374
+ indices,
375
+ primitiveType: PrimitiveType_default.TRIANGLES,
376
+ boundingSphere,
377
+ offsetAttribute: cylinderGeometry._offsetAttribute
378
+ });
379
+ };
380
+ var unitCylinderGeometry;
381
+ CylinderGeometry.getUnitCylinder = function() {
382
+ if (!defined_default(unitCylinderGeometry)) {
383
+ unitCylinderGeometry = CylinderGeometry.createGeometry(
384
+ new CylinderGeometry({
385
+ topRadius: 1,
386
+ bottomRadius: 1,
387
+ length: 1,
388
+ vertexFormat: VertexFormat_default.POSITION_ONLY
389
+ })
390
+ );
391
+ }
392
+ return unitCylinderGeometry;
393
+ };
394
+ var CylinderGeometry_default = CylinderGeometry;
395
+
396
+ export {
397
+ CylinderGeometry_default
398
+ };