deeptwins-cesium-engine 0.1.2 → 0.1.4

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 (219) hide show
  1. package/Build/Workers/chunk-2HWLF3FT.js +837 -0
  2. package/Build/Workers/chunk-2KXMJ5XS.js +3792 -0
  3. package/Build/Workers/chunk-2NPCLB3H.js +56 -0
  4. package/Build/Workers/chunk-2ZHQTIBH.js +1483 -0
  5. package/Build/Workers/chunk-3GLYOW63.js +352 -0
  6. package/Build/Workers/chunk-3L22KMPU.js +219 -0
  7. package/Build/Workers/chunk-3Q6V2B2I.js +73 -0
  8. package/Build/Workers/chunk-3QOKKRIG.js +387 -0
  9. package/Build/Workers/chunk-44YZFGRH.js +1800 -0
  10. package/Build/Workers/chunk-45VV4SBO.js +2342 -0
  11. package/Build/Workers/chunk-4EJ4AA2S.js +368 -0
  12. package/Build/Workers/chunk-4IJFHUL6.js +414 -0
  13. package/Build/Workers/chunk-4K3V5CGW.js +454 -0
  14. package/Build/Workers/chunk-4M4QL6KJ.js +305 -0
  15. package/Build/Workers/chunk-4YNRIEQ6.js +288 -0
  16. package/Build/Workers/chunk-56CVDPH5.js +352 -0
  17. package/Build/Workers/chunk-5CTAAPXH.js +1483 -0
  18. package/Build/Workers/chunk-5ISZ6NJD.js +102 -0
  19. package/Build/Workers/chunk-5SDHYIOS.js +56 -0
  20. package/Build/Workers/chunk-66TGUMCU.js +2719 -0
  21. package/Build/Workers/chunk-6EJMTDQJ.js +163 -0
  22. package/Build/Workers/chunk-6VWXYSMH.js +959 -0
  23. package/Build/Workers/chunk-6VZ7VB2Q.js +241 -0
  24. package/Build/Workers/chunk-7AMRE57Q.js +301 -0
  25. package/Build/Workers/chunk-7DH6C33H.js +398 -0
  26. package/Build/Workers/chunk-7VUS3FVE.js +38 -0
  27. package/Build/Workers/chunk-7Y3ZA6H3.js +198 -0
  28. package/Build/Workers/chunk-A6BMHZNA.js +38 -0
  29. package/Build/Workers/chunk-A7XY2MN7.js +171 -0
  30. package/Build/Workers/chunk-AC7ND63S.js +57 -0
  31. package/Build/Workers/chunk-AHCZ757M.js +9230 -0
  32. package/Build/Workers/chunk-ANOA7E7F.js +56 -0
  33. package/Build/Workers/chunk-AYO5HHV6.js +789 -0
  34. package/Build/Workers/chunk-BE2N56VZ.js +1344 -0
  35. package/Build/Workers/chunk-BR3BPM64.js +9230 -0
  36. package/Build/Workers/chunk-BVMRWGOK.js +455 -0
  37. package/Build/Workers/chunk-BXEL2NX7.js +455 -0
  38. package/Build/Workers/chunk-C5BO2JCG.js +278 -0
  39. package/Build/Workers/chunk-CIRQNZVR.js +301 -0
  40. package/Build/Workers/chunk-CM67CQME.js +305 -0
  41. package/Build/Workers/chunk-D3QIW4DH.js +630 -0
  42. package/Build/Workers/chunk-E5W7QIGZ.js +511 -0
  43. package/Build/Workers/chunk-E6CYGUJI.js +1054 -0
  44. package/Build/Workers/chunk-EIZ23IOX.js +414 -0
  45. package/Build/Workers/chunk-EIZJUMQY.js +101 -0
  46. package/Build/Workers/chunk-EXTMZJXB.js +82 -0
  47. package/Build/Workers/chunk-EYOOSIBW.js +682 -0
  48. package/Build/Workers/chunk-F37WADVC.js +1054 -0
  49. package/Build/Workers/chunk-FIWPJFHX.js +101 -0
  50. package/Build/Workers/chunk-FM32TNGT.js +198 -0
  51. package/Build/Workers/chunk-FOMYIEIB.js +476 -0
  52. package/Build/Workers/chunk-FWYDLSVQ.js +97 -0
  53. package/Build/Workers/chunk-HGZR6CZF.js +1067 -0
  54. package/Build/Workers/chunk-HIXHDABG.js +288 -0
  55. package/Build/Workers/chunk-HMCCZZWE.js +97 -0
  56. package/Build/Workers/chunk-HW54WHGM.js +2719 -0
  57. package/Build/Workers/chunk-IHYAI7GF.js +973 -0
  58. package/Build/Workers/chunk-INLQ7LVK.js +837 -0
  59. package/Build/Workers/chunk-IQMESTCB.js +124 -0
  60. package/Build/Workers/chunk-J4PISUNT.js +2342 -0
  61. package/Build/Workers/chunk-JSWU557I.js +693 -0
  62. package/Build/Workers/chunk-KHONDSQ7.js +693 -0
  63. package/Build/Workers/chunk-KLUL2SOE.js +352 -0
  64. package/Build/Workers/chunk-KMBLKQCC.js +1992 -0
  65. package/Build/Workers/chunk-KOTWWQN7.js +171 -0
  66. package/Build/Workers/chunk-KWV6ZTF4.js +163 -0
  67. package/Build/Workers/chunk-LSEFPQHG.js +476 -0
  68. package/Build/Workers/chunk-M66X4O24.js +44 -0
  69. package/Build/Workers/chunk-M6IXKBC7.js +1992 -0
  70. package/Build/Workers/chunk-MFUC3D5C.js +162 -0
  71. package/Build/Workers/chunk-MRMNELAH.js +82 -0
  72. package/Build/Workers/chunk-N3NUA5H2.js +3792 -0
  73. package/Build/Workers/chunk-NFB2NXJN.js +138 -0
  74. package/Build/Workers/chunk-NQAXBK4K.js +789 -0
  75. package/Build/Workers/chunk-NUGQWV6S.js +352 -0
  76. package/Build/Workers/chunk-O7S7WL7K.js +278 -0
  77. package/Build/Workers/chunk-ODZYB26X.js +1287 -0
  78. package/Build/Workers/chunk-OEHJY463.js +3201 -0
  79. package/Build/Workers/chunk-OMMRNMXF.js +44 -0
  80. package/Build/Workers/chunk-OZ3CQDO3.js +138 -0
  81. package/Build/Workers/chunk-PNXBG64I.js +219 -0
  82. package/Build/Workers/chunk-PYR35GK4.js +973 -0
  83. package/Build/Workers/chunk-Q4CXGW74.js +57 -0
  84. package/Build/Workers/chunk-QGISLKCW.js +147 -0
  85. package/Build/Workers/chunk-QQHVOJW6.js +497 -0
  86. package/Build/Workers/chunk-QWCMMRJW.js +58 -0
  87. package/Build/Workers/chunk-RDEZCHF4.js +398 -0
  88. package/Build/Workers/chunk-SJTE7FVN.js +778 -0
  89. package/Build/Workers/chunk-SM5T67LR.js +162 -0
  90. package/Build/Workers/chunk-T27NNXEU.js +58 -0
  91. package/Build/Workers/chunk-T4J5BWUO.js +511 -0
  92. package/Build/Workers/chunk-T6JS4BRN.js +140 -0
  93. package/Build/Workers/chunk-UH6DUQBW.js +140 -0
  94. package/Build/Workers/chunk-UJAH6XKF.js +73 -0
  95. package/Build/Workers/chunk-UKSTJ2PH.js +454 -0
  96. package/Build/Workers/chunk-UQCDCCZ7.js +368 -0
  97. package/Build/Workers/chunk-UXIFNEA3.js +1287 -0
  98. package/Build/Workers/chunk-UXJ6J5L7.js +56 -0
  99. package/Build/Workers/chunk-V4VUAZXI.js +1800 -0
  100. package/Build/Workers/chunk-VQH2YXO2.js +497 -0
  101. package/Build/Workers/chunk-VXKCLSE4.js +241 -0
  102. package/Build/Workers/chunk-W3U6YBEI.js +280 -0
  103. package/Build/Workers/chunk-W75ZVFKP.js +778 -0
  104. package/Build/Workers/chunk-WCDFJYFB.js +1344 -0
  105. package/Build/Workers/chunk-WME5M6W3.js +630 -0
  106. package/Build/Workers/chunk-XDQBQB64.js +1067 -0
  107. package/Build/Workers/chunk-Y6HOIWE5.js +959 -0
  108. package/Build/Workers/chunk-YEMC2ZOR.js +147 -0
  109. package/Build/Workers/chunk-YWNF3TPE.js +682 -0
  110. package/Build/Workers/chunk-Z55VGWJP.js +280 -0
  111. package/Build/Workers/chunk-Z5YWP24C.js +124 -0
  112. package/Build/Workers/chunk-ZHXCWUJB.js +387 -0
  113. package/Build/Workers/chunk-ZIMPUF2I.js +102 -0
  114. package/Build/Workers/chunk-ZKDWYQKC.js +3201 -0
  115. package/Build/Workers/combineGeometry.js +24 -22
  116. package/Build/Workers/createBoxGeometry.js +18 -16
  117. package/Build/Workers/createBoxOutlineGeometry.js +23 -25
  118. package/Build/Workers/createCircleGeometry.js +29 -27
  119. package/Build/Workers/createCircleOutlineGeometry.js +22 -20
  120. package/Build/Workers/createCoplanarPolygonGeometry.js +43 -43
  121. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +37 -35
  122. package/Build/Workers/createCorridorGeometry.js +46 -49
  123. package/Build/Workers/createCorridorOutlineGeometry.js +40 -43
  124. package/Build/Workers/createCylinderGeometry.js +20 -18
  125. package/Build/Workers/createCylinderOutlineGeometry.js +27 -25
  126. package/Build/Workers/createEllipseGeometry.js +28 -25
  127. package/Build/Workers/createEllipseOutlineGeometry.js +21 -18
  128. package/Build/Workers/createEllipsoidGeometry.js +19 -17
  129. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -16
  130. package/Build/Workers/createFrustumGeometry.js +18 -16
  131. package/Build/Workers/createFrustumOutlineGeometry.js +21 -21
  132. package/Build/Workers/createGeometry.js +31 -26
  133. package/Build/Workers/createGroundPolylineGeometry.js +188 -135
  134. package/Build/Workers/createPlaneGeometry.js +22 -21
  135. package/Build/Workers/createPlaneOutlineGeometry.js +15 -13
  136. package/Build/Workers/createPolygonGeometry.js +51 -52
  137. package/Build/Workers/createPolygonOutlineGeometry.js +43 -44
  138. package/Build/Workers/createPolylineGeometry.js +37 -40
  139. package/Build/Workers/createPolylineVolumeGeometry.js +41 -44
  140. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +36 -39
  141. package/Build/Workers/createRectangleGeometry.js +47 -53
  142. package/Build/Workers/createRectangleOutlineGeometry.js +32 -33
  143. package/Build/Workers/createSimplePolylineGeometry.js +33 -34
  144. package/Build/Workers/createSphereGeometry.js +20 -20
  145. package/Build/Workers/createSphereOutlineGeometry.js +19 -19
  146. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  147. package/Build/Workers/createVectorTileClampedPolylines.js +16 -14
  148. package/Build/Workers/createVectorTileGeometries.js +24 -22
  149. package/Build/Workers/createVectorTilePoints.js +15 -13
  150. package/Build/Workers/createVectorTilePolygons.js +24 -21
  151. package/Build/Workers/createVectorTilePolylines.js +16 -14
  152. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  153. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +29 -27
  154. package/Build/Workers/createVerticesFromHeightmap.js +42 -63
  155. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -280
  156. package/Build/Workers/createWallGeometry.js +35 -36
  157. package/Build/Workers/createWallOutlineGeometry.js +33 -34
  158. package/Build/Workers/decodeDraco.js +10 -11
  159. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  160. package/Build/Workers/decodeI3S.js +16 -20
  161. package/Build/Workers/gaussianSplatSorter.js +4 -4
  162. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  163. package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
  164. package/Build/Workers/transcodeKTX2.js +42 -14
  165. package/Build/Workers/transferTypedArrayTest.js +1 -1
  166. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -21
  167. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  168. package/Source/Shaders/BillboardCollectionFS.js +85 -81
  169. package/Source/Shaders/BillboardCollectionVS.js +60 -118
  170. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  171. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  172. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  173. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
  174. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  175. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
  176. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  177. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  178. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  179. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  180. package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
  181. package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
  182. package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
  183. package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
  184. package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +2 -1
  185. package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
  186. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
  187. package/Source/Shaders/EllipsoidVS.js +4 -4
  188. package/Source/Shaders/FXAA3_11.js +2 -0
  189. package/Source/Shaders/GlobeFS.js +22 -0
  190. package/Source/Shaders/GlobeVS.js +3 -2
  191. package/Source/Shaders/Model/MaterialStageFS.js +50 -20
  192. package/Source/Shaders/Model/MetadataStageFS.js +2 -1
  193. package/Source/Shaders/Model/MetadataStageVS.js +2 -1
  194. package/Source/Shaders/Model/ModelFS.js +32 -2
  195. package/Source/Shaders/Model/ModelVS.js +15 -1
  196. package/Source/Shaders/Model/PointCloudStylingStageVS.js +2 -1
  197. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
  198. package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
  199. package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
  200. package/Source/Shaders/PolylineCommon.js +1 -1
  201. package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
  202. package/Source/Shaders/SkyAtmosphereVS.js +2 -1
  203. package/Source/Shaders/Voxels/IntersectBox.js +20 -33
  204. package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
  205. package/Source/Shaders/Voxels/IntersectDepth.js +10 -6
  206. package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
  207. package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
  208. package/Source/Shaders/Voxels/Intersection.js +3 -5
  209. package/Source/Shaders/Voxels/IntersectionUtils.js +2 -1
  210. package/Source/Shaders/Voxels/Megatexture.js +15 -83
  211. package/Source/Shaders/Voxels/Octree.js +53 -61
  212. package/Source/Shaders/Voxels/VoxelFS.js +67 -52
  213. package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
  214. package/index.js +346 -261
  215. package/package.json +1 -1
  216. package/Source/Shaders/Voxels/IntersectClippingPlanes.js +0 -80
  217. package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
  218. package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
  219. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
@@ -0,0 +1,278 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.1.4
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-D3QIW4DH.js";
29
+ import {
30
+ DeveloperError_default
31
+ } from "./chunk-KWV6ZTF4.js";
32
+ import {
33
+ defined_default
34
+ } from "./chunk-MRMNELAH.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,301 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.1.3
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
+ Matrix2_default,
28
+ Quaternion_default,
29
+ Rectangle_default,
30
+ Transforms_default
31
+ } from "./chunk-AHCZ757M.js";
32
+ import {
33
+ Matrix4_default
34
+ } from "./chunk-ZKDWYQKC.js";
35
+ import {
36
+ WebGLConstants_default
37
+ } from "./chunk-WME5M6W3.js";
38
+ import {
39
+ Cartesian2_default,
40
+ Cartographic_default
41
+ } from "./chunk-KMBLKQCC.js";
42
+ import {
43
+ Cartesian3_default,
44
+ Frozen_default,
45
+ Matrix3_default
46
+ } from "./chunk-45VV4SBO.js";
47
+ import {
48
+ Check_default,
49
+ DeveloperError_default
50
+ } from "./chunk-6EJMTDQJ.js";
51
+ import {
52
+ defined_default
53
+ } from "./chunk-EXTMZJXB.js";
54
+
55
+ // packages/engine/Source/Core/GeometryType.js
56
+ var GeometryType = {
57
+ NONE: 0,
58
+ TRIANGLES: 1,
59
+ LINES: 2,
60
+ POLYLINES: 3
61
+ };
62
+ Object.freeze(GeometryType);
63
+ var GeometryType_default = GeometryType;
64
+
65
+ // packages/engine/Source/Core/PrimitiveType.js
66
+ var PrimitiveType = {
67
+ /**
68
+ * Points primitive where each vertex (or index) is a separate point.
69
+ *
70
+ * @type {number}
71
+ * @constant
72
+ */
73
+ POINTS: WebGLConstants_default.POINTS,
74
+ /**
75
+ * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
76
+ *
77
+ * @type {number}
78
+ * @constant
79
+ */
80
+ LINES: WebGLConstants_default.LINES,
81
+ /**
82
+ * Line loop primitive where each vertex (or index) after the first connects a line to
83
+ * the previous vertex, and the last vertex implicitly connects to the first.
84
+ *
85
+ * @type {number}
86
+ * @constant
87
+ */
88
+ LINE_LOOP: WebGLConstants_default.LINE_LOOP,
89
+ /**
90
+ * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
91
+ *
92
+ * @type {number}
93
+ * @constant
94
+ */
95
+ LINE_STRIP: WebGLConstants_default.LINE_STRIP,
96
+ /**
97
+ * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
98
+ *
99
+ * @type {number}
100
+ * @constant
101
+ */
102
+ TRIANGLES: WebGLConstants_default.TRIANGLES,
103
+ /**
104
+ * Triangle strip primitive where each vertex (or index) after the first two connect to
105
+ * the previous two vertices forming a triangle. For example, this can be used to model a wall.
106
+ *
107
+ * @type {number}
108
+ * @constant
109
+ */
110
+ TRIANGLE_STRIP: WebGLConstants_default.TRIANGLE_STRIP,
111
+ /**
112
+ * Triangle fan primitive where each vertex (or index) after the first two connect to
113
+ * the previous vertex and the first vertex forming a triangle. For example, this can be used
114
+ * to model a cone or circle.
115
+ *
116
+ * @type {number}
117
+ * @constant
118
+ */
119
+ TRIANGLE_FAN: WebGLConstants_default.TRIANGLE_FAN
120
+ };
121
+ PrimitiveType.isLines = function(primitiveType) {
122
+ return primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP;
123
+ };
124
+ PrimitiveType.isTriangles = function(primitiveType) {
125
+ return primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
126
+ };
127
+ PrimitiveType.validate = function(primitiveType) {
128
+ return primitiveType === PrimitiveType.POINTS || primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP || primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
129
+ };
130
+ Object.freeze(PrimitiveType);
131
+ var PrimitiveType_default = PrimitiveType;
132
+
133
+ // packages/engine/Source/Core/Geometry.js
134
+ function Geometry(options) {
135
+ options = options ?? Frozen_default.EMPTY_OBJECT;
136
+ Check_default.typeOf.object("options.attributes", options.attributes);
137
+ this.attributes = options.attributes;
138
+ this.indices = options.indices;
139
+ this.primitiveType = options.primitiveType ?? PrimitiveType_default.TRIANGLES;
140
+ this.boundingSphere = options.boundingSphere;
141
+ this.geometryType = options.geometryType ?? GeometryType_default.NONE;
142
+ this.boundingSphereCV = options.boundingSphereCV;
143
+ this.offsetAttribute = options.offsetAttribute;
144
+ }
145
+ Geometry.computeNumberOfVertices = function(geometry) {
146
+ Check_default.typeOf.object("geometry", geometry);
147
+ let numberOfVertices = -1;
148
+ for (const property in geometry.attributes) {
149
+ if (geometry.attributes.hasOwnProperty(property) && defined_default(geometry.attributes[property]) && defined_default(geometry.attributes[property].values)) {
150
+ const attribute = geometry.attributes[property];
151
+ const num = attribute.values.length / attribute.componentsPerAttribute;
152
+ if (numberOfVertices !== num && numberOfVertices !== -1) {
153
+ throw new DeveloperError_default(
154
+ "All attribute lists must have the same number of attributes."
155
+ );
156
+ }
157
+ numberOfVertices = num;
158
+ }
159
+ }
160
+ return numberOfVertices;
161
+ };
162
+ var rectangleCenterScratch = new Cartographic_default();
163
+ var enuCenterScratch = new Cartesian3_default();
164
+ var fixedFrameToEnuScratch = new Matrix4_default();
165
+ var boundingRectanglePointsCartographicScratch = [
166
+ new Cartographic_default(),
167
+ new Cartographic_default(),
168
+ new Cartographic_default()
169
+ ];
170
+ var boundingRectanglePointsEnuScratch = [
171
+ new Cartesian2_default(),
172
+ new Cartesian2_default(),
173
+ new Cartesian2_default()
174
+ ];
175
+ var points2DScratch = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
176
+ var pointEnuScratch = new Cartesian3_default();
177
+ var enuRotationScratch = new Quaternion_default();
178
+ var enuRotationMatrixScratch = new Matrix4_default();
179
+ var rotation2DScratch = new Matrix2_default();
180
+ Geometry._textureCoordinateRotationPoints = function(positions, stRotation, ellipsoid, boundingRectangle) {
181
+ let i;
182
+ const rectangleCenter = Rectangle_default.center(
183
+ boundingRectangle,
184
+ rectangleCenterScratch
185
+ );
186
+ const enuCenter = Cartographic_default.toCartesian(
187
+ rectangleCenter,
188
+ ellipsoid,
189
+ enuCenterScratch
190
+ );
191
+ const enuToFixedFrame = Transforms_default.eastNorthUpToFixedFrame(
192
+ enuCenter,
193
+ ellipsoid,
194
+ fixedFrameToEnuScratch
195
+ );
196
+ const fixedFrameToEnu = Matrix4_default.inverse(
197
+ enuToFixedFrame,
198
+ fixedFrameToEnuScratch
199
+ );
200
+ const boundingPointsEnu = boundingRectanglePointsEnuScratch;
201
+ const boundingPointsCarto = boundingRectanglePointsCartographicScratch;
202
+ boundingPointsCarto[0].longitude = boundingRectangle.west;
203
+ boundingPointsCarto[0].latitude = boundingRectangle.south;
204
+ boundingPointsCarto[1].longitude = boundingRectangle.west;
205
+ boundingPointsCarto[1].latitude = boundingRectangle.north;
206
+ boundingPointsCarto[2].longitude = boundingRectangle.east;
207
+ boundingPointsCarto[2].latitude = boundingRectangle.south;
208
+ let posEnu = pointEnuScratch;
209
+ for (i = 0; i < 3; i++) {
210
+ Cartographic_default.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);
211
+ posEnu = Matrix4_default.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);
212
+ boundingPointsEnu[i].x = posEnu.x;
213
+ boundingPointsEnu[i].y = posEnu.y;
214
+ }
215
+ const rotation = Quaternion_default.fromAxisAngle(
216
+ Cartesian3_default.UNIT_Z,
217
+ -stRotation,
218
+ enuRotationScratch
219
+ );
220
+ const textureMatrix = Matrix3_default.fromQuaternion(
221
+ rotation,
222
+ enuRotationMatrixScratch
223
+ );
224
+ const positionsLength = positions.length;
225
+ let enuMinX = Number.POSITIVE_INFINITY;
226
+ let enuMinY = Number.POSITIVE_INFINITY;
227
+ let enuMaxX = Number.NEGATIVE_INFINITY;
228
+ let enuMaxY = Number.NEGATIVE_INFINITY;
229
+ for (i = 0; i < positionsLength; i++) {
230
+ posEnu = Matrix4_default.multiplyByPointAsVector(
231
+ fixedFrameToEnu,
232
+ positions[i],
233
+ posEnu
234
+ );
235
+ posEnu = Matrix3_default.multiplyByVector(textureMatrix, posEnu, posEnu);
236
+ enuMinX = Math.min(enuMinX, posEnu.x);
237
+ enuMinY = Math.min(enuMinY, posEnu.y);
238
+ enuMaxX = Math.max(enuMaxX, posEnu.x);
239
+ enuMaxY = Math.max(enuMaxY, posEnu.y);
240
+ }
241
+ const toDesiredInComputed = Matrix2_default.fromRotation(
242
+ stRotation,
243
+ rotation2DScratch
244
+ );
245
+ const points2D = points2DScratch;
246
+ points2D[0].x = enuMinX;
247
+ points2D[0].y = enuMinY;
248
+ points2D[1].x = enuMinX;
249
+ points2D[1].y = enuMaxY;
250
+ points2D[2].x = enuMaxX;
251
+ points2D[2].y = enuMinY;
252
+ const boundingEnuMin = boundingPointsEnu[0];
253
+ const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;
254
+ const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;
255
+ for (i = 0; i < 3; i++) {
256
+ const point2D = points2D[i];
257
+ Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
258
+ point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;
259
+ point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;
260
+ }
261
+ const minXYCorner = points2D[0];
262
+ const maxYCorner = points2D[1];
263
+ const maxXCorner = points2D[2];
264
+ const result = new Array(6);
265
+ Cartesian2_default.pack(minXYCorner, result);
266
+ Cartesian2_default.pack(maxYCorner, result, 2);
267
+ Cartesian2_default.pack(maxXCorner, result, 4);
268
+ return result;
269
+ };
270
+ var Geometry_default = Geometry;
271
+
272
+ // packages/engine/Source/Core/GeometryAttribute.js
273
+ function GeometryAttribute(options) {
274
+ options = options ?? Frozen_default.EMPTY_OBJECT;
275
+ if (!defined_default(options.componentDatatype)) {
276
+ throw new DeveloperError_default("options.componentDatatype is required.");
277
+ }
278
+ if (!defined_default(options.componentsPerAttribute)) {
279
+ throw new DeveloperError_default("options.componentsPerAttribute is required.");
280
+ }
281
+ if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
282
+ throw new DeveloperError_default(
283
+ "options.componentsPerAttribute must be between 1 and 4."
284
+ );
285
+ }
286
+ if (!defined_default(options.values)) {
287
+ throw new DeveloperError_default("options.values is required.");
288
+ }
289
+ this.componentDatatype = options.componentDatatype;
290
+ this.componentsPerAttribute = options.componentsPerAttribute;
291
+ this.normalize = options.normalize ?? false;
292
+ this.values = options.values;
293
+ }
294
+ var GeometryAttribute_default = GeometryAttribute;
295
+
296
+ export {
297
+ GeometryType_default,
298
+ PrimitiveType_default,
299
+ Geometry_default,
300
+ GeometryAttribute_default
301
+ };