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,44 @@
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
+ Frozen_default
28
+ } from "./chunk-J4PISUNT.js";
29
+
30
+ // packages/engine/Source/Core/GeometryAttributes.js
31
+ function GeometryAttributes(options) {
32
+ options = options ?? Frozen_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,138 @@
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
+ Frozen_default
28
+ } from "./chunk-J4PISUNT.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/VertexFormat.js
37
+ function VertexFormat(options) {
38
+ options = options ?? Frozen_default.EMPTY_OBJECT;
39
+ this.position = options.position ?? false;
40
+ this.normal = options.normal ?? false;
41
+ this.st = options.st ?? false;
42
+ this.bitangent = options.bitangent ?? false;
43
+ this.tangent = options.tangent ?? false;
44
+ this.color = options.color ?? false;
45
+ }
46
+ VertexFormat.POSITION_ONLY = Object.freeze(
47
+ new VertexFormat({
48
+ position: true
49
+ })
50
+ );
51
+ VertexFormat.POSITION_AND_NORMAL = Object.freeze(
52
+ new VertexFormat({
53
+ position: true,
54
+ normal: true
55
+ })
56
+ );
57
+ VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(
58
+ new VertexFormat({
59
+ position: true,
60
+ normal: true,
61
+ st: true
62
+ })
63
+ );
64
+ VertexFormat.POSITION_AND_ST = Object.freeze(
65
+ new VertexFormat({
66
+ position: true,
67
+ st: true
68
+ })
69
+ );
70
+ VertexFormat.POSITION_AND_COLOR = Object.freeze(
71
+ new VertexFormat({
72
+ position: true,
73
+ color: true
74
+ })
75
+ );
76
+ VertexFormat.ALL = Object.freeze(
77
+ new VertexFormat({
78
+ position: true,
79
+ normal: true,
80
+ st: true,
81
+ tangent: true,
82
+ bitangent: true
83
+ })
84
+ );
85
+ VertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;
86
+ VertexFormat.packedLength = 6;
87
+ VertexFormat.pack = function(value, array, startingIndex) {
88
+ if (!defined_default(value)) {
89
+ throw new DeveloperError_default("value is required");
90
+ }
91
+ if (!defined_default(array)) {
92
+ throw new DeveloperError_default("array is required");
93
+ }
94
+ startingIndex = startingIndex ?? 0;
95
+ array[startingIndex++] = value.position ? 1 : 0;
96
+ array[startingIndex++] = value.normal ? 1 : 0;
97
+ array[startingIndex++] = value.st ? 1 : 0;
98
+ array[startingIndex++] = value.tangent ? 1 : 0;
99
+ array[startingIndex++] = value.bitangent ? 1 : 0;
100
+ array[startingIndex] = value.color ? 1 : 0;
101
+ return array;
102
+ };
103
+ VertexFormat.unpack = function(array, startingIndex, result) {
104
+ if (!defined_default(array)) {
105
+ throw new DeveloperError_default("array is required");
106
+ }
107
+ startingIndex = startingIndex ?? 0;
108
+ if (!defined_default(result)) {
109
+ result = new VertexFormat();
110
+ }
111
+ result.position = array[startingIndex++] === 1;
112
+ result.normal = array[startingIndex++] === 1;
113
+ result.st = array[startingIndex++] === 1;
114
+ result.tangent = array[startingIndex++] === 1;
115
+ result.bitangent = array[startingIndex++] === 1;
116
+ result.color = array[startingIndex] === 1;
117
+ return result;
118
+ };
119
+ VertexFormat.clone = function(vertexFormat, result) {
120
+ if (!defined_default(vertexFormat)) {
121
+ return void 0;
122
+ }
123
+ if (!defined_default(result)) {
124
+ result = new VertexFormat();
125
+ }
126
+ result.position = vertexFormat.position;
127
+ result.normal = vertexFormat.normal;
128
+ result.st = vertexFormat.st;
129
+ result.tangent = vertexFormat.tangent;
130
+ result.bitangent = vertexFormat.bitangent;
131
+ result.color = vertexFormat.color;
132
+ return result;
133
+ };
134
+ var VertexFormat_default = VertexFormat;
135
+
136
+ export {
137
+ VertexFormat_default
138
+ };
@@ -0,0 +1,219 @@
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
+ GeographicProjection_default
28
+ } from "./chunk-ODZYB26X.js";
29
+ import {
30
+ Intersect_default
31
+ } from "./chunk-ANOA7E7F.js";
32
+ import {
33
+ Rectangle_default
34
+ } from "./chunk-BR3BPM64.js";
35
+ import {
36
+ Cartesian2_default,
37
+ Cartographic_default,
38
+ Ellipsoid_default
39
+ } from "./chunk-M6IXKBC7.js";
40
+ import {
41
+ Check_default
42
+ } from "./chunk-KWV6ZTF4.js";
43
+ import {
44
+ defined_default
45
+ } from "./chunk-MRMNELAH.js";
46
+
47
+ // packages/engine/Source/Core/BoundingRectangle.js
48
+ function BoundingRectangle(x, y, width, height) {
49
+ this.x = x ?? 0;
50
+ this.y = y ?? 0;
51
+ this.width = width ?? 0;
52
+ this.height = height ?? 0;
53
+ }
54
+ BoundingRectangle.packedLength = 4;
55
+ BoundingRectangle.pack = function(value, array, startingIndex) {
56
+ Check_default.typeOf.object("value", value);
57
+ Check_default.defined("array", array);
58
+ startingIndex = startingIndex ?? 0;
59
+ array[startingIndex++] = value.x;
60
+ array[startingIndex++] = value.y;
61
+ array[startingIndex++] = value.width;
62
+ array[startingIndex] = value.height;
63
+ return array;
64
+ };
65
+ BoundingRectangle.unpack = function(array, startingIndex, result) {
66
+ Check_default.defined("array", array);
67
+ startingIndex = startingIndex ?? 0;
68
+ if (!defined_default(result)) {
69
+ result = new BoundingRectangle();
70
+ }
71
+ result.x = array[startingIndex++];
72
+ result.y = array[startingIndex++];
73
+ result.width = array[startingIndex++];
74
+ result.height = array[startingIndex];
75
+ return result;
76
+ };
77
+ BoundingRectangle.fromPoints = function(positions, result) {
78
+ if (!defined_default(result)) {
79
+ result = new BoundingRectangle();
80
+ }
81
+ if (!defined_default(positions) || positions.length === 0) {
82
+ result.x = 0;
83
+ result.y = 0;
84
+ result.width = 0;
85
+ result.height = 0;
86
+ return result;
87
+ }
88
+ const length = positions.length;
89
+ let minimumX = positions[0].x;
90
+ let minimumY = positions[0].y;
91
+ let maximumX = positions[0].x;
92
+ let maximumY = positions[0].y;
93
+ for (let i = 1; i < length; i++) {
94
+ const p = positions[i];
95
+ const x = p.x;
96
+ const y = p.y;
97
+ minimumX = Math.min(x, minimumX);
98
+ maximumX = Math.max(x, maximumX);
99
+ minimumY = Math.min(y, minimumY);
100
+ maximumY = Math.max(y, maximumY);
101
+ }
102
+ result.x = minimumX;
103
+ result.y = minimumY;
104
+ result.width = maximumX - minimumX;
105
+ result.height = maximumY - minimumY;
106
+ return result;
107
+ };
108
+ var defaultProjection = new GeographicProjection_default();
109
+ var fromRectangleLowerLeft = new Cartographic_default();
110
+ var fromRectangleUpperRight = new Cartographic_default();
111
+ BoundingRectangle.fromRectangle = function(rectangle, projection, result) {
112
+ if (!defined_default(result)) {
113
+ result = new BoundingRectangle();
114
+ }
115
+ if (!defined_default(rectangle)) {
116
+ result.x = 0;
117
+ result.y = 0;
118
+ result.width = 0;
119
+ result.height = 0;
120
+ return result;
121
+ }
122
+ defaultProjection._ellipsoid = Ellipsoid_default.default;
123
+ projection = projection ?? defaultProjection;
124
+ const lowerLeft = projection.project(
125
+ Rectangle_default.southwest(rectangle, fromRectangleLowerLeft)
126
+ );
127
+ const upperRight = projection.project(
128
+ Rectangle_default.northeast(rectangle, fromRectangleUpperRight)
129
+ );
130
+ Cartesian2_default.subtract(upperRight, lowerLeft, upperRight);
131
+ result.x = lowerLeft.x;
132
+ result.y = lowerLeft.y;
133
+ result.width = upperRight.x;
134
+ result.height = upperRight.y;
135
+ return result;
136
+ };
137
+ BoundingRectangle.clone = function(rectangle, result) {
138
+ if (!defined_default(rectangle)) {
139
+ return void 0;
140
+ }
141
+ if (!defined_default(result)) {
142
+ return new BoundingRectangle(
143
+ rectangle.x,
144
+ rectangle.y,
145
+ rectangle.width,
146
+ rectangle.height
147
+ );
148
+ }
149
+ result.x = rectangle.x;
150
+ result.y = rectangle.y;
151
+ result.width = rectangle.width;
152
+ result.height = rectangle.height;
153
+ return result;
154
+ };
155
+ BoundingRectangle.union = function(left, right, result) {
156
+ Check_default.typeOf.object("left", left);
157
+ Check_default.typeOf.object("right", right);
158
+ if (!defined_default(result)) {
159
+ result = new BoundingRectangle();
160
+ }
161
+ const lowerLeftX = Math.min(left.x, right.x);
162
+ const lowerLeftY = Math.min(left.y, right.y);
163
+ const upperRightX = Math.max(left.x + left.width, right.x + right.width);
164
+ const upperRightY = Math.max(left.y + left.height, right.y + right.height);
165
+ result.x = lowerLeftX;
166
+ result.y = lowerLeftY;
167
+ result.width = upperRightX - lowerLeftX;
168
+ result.height = upperRightY - lowerLeftY;
169
+ return result;
170
+ };
171
+ BoundingRectangle.expand = function(rectangle, point, result) {
172
+ Check_default.typeOf.object("rectangle", rectangle);
173
+ Check_default.typeOf.object("point", point);
174
+ result = BoundingRectangle.clone(rectangle, result);
175
+ const width = point.x - result.x;
176
+ const height = point.y - result.y;
177
+ if (width > result.width) {
178
+ result.width = width;
179
+ } else if (width < 0) {
180
+ result.width -= width;
181
+ result.x = point.x;
182
+ }
183
+ if (height > result.height) {
184
+ result.height = height;
185
+ } else if (height < 0) {
186
+ result.height -= height;
187
+ result.y = point.y;
188
+ }
189
+ return result;
190
+ };
191
+ BoundingRectangle.intersect = function(left, right) {
192
+ Check_default.typeOf.object("left", left);
193
+ Check_default.typeOf.object("right", right);
194
+ const leftX = left.x;
195
+ const leftY = left.y;
196
+ const rightX = right.x;
197
+ const rightY = right.y;
198
+ if (!(leftX > rightX + right.width || leftX + left.width < rightX || leftY + left.height < rightY || leftY > rightY + right.height)) {
199
+ return Intersect_default.INTERSECTING;
200
+ }
201
+ return Intersect_default.OUTSIDE;
202
+ };
203
+ BoundingRectangle.equals = function(left, right) {
204
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.width === right.width && left.height === right.height;
205
+ };
206
+ BoundingRectangle.prototype.clone = function(result) {
207
+ return BoundingRectangle.clone(this, result);
208
+ };
209
+ BoundingRectangle.prototype.intersect = function(right) {
210
+ return BoundingRectangle.intersect(this, right);
211
+ };
212
+ BoundingRectangle.prototype.equals = function(right) {
213
+ return BoundingRectangle.equals(this, right);
214
+ };
215
+ var BoundingRectangle_default = BoundingRectangle;
216
+
217
+ export {
218
+ BoundingRectangle_default
219
+ };