@cesium/engine 3.0.1 → 4.0.0

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 (234) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
  3. package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
  4. package/Build/Workers/chunk-27R2KRIK.js +634 -0
  5. package/Build/Workers/chunk-2C65EKYA.js +55 -0
  6. package/Build/Workers/chunk-2NLMZNJI.js +138 -0
  7. package/Build/Workers/chunk-4V6RCTVH.js +289 -0
  8. package/Build/Workers/chunk-4VWUFKYW.js +368 -0
  9. package/Build/Workers/chunk-527JG4D7.js +629 -0
  10. package/Build/Workers/chunk-5U4UHRZ2.js +8644 -0
  11. package/Build/Workers/chunk-7CZEWQWE.js +353 -0
  12. package/Build/Workers/chunk-7IMAWM6A.js +842 -0
  13. package/Build/Workers/{package.js → chunk-A6EA6KIE.js} +13 -2
  14. package/Build/Workers/chunk-AXGQUPXA.js +1075 -0
  15. package/Build/Workers/chunk-BT6YIL2N.js +39 -0
  16. package/Build/Workers/chunk-C6MRR5YL.js +476 -0
  17. package/Build/Workers/chunk-DJUTBX6A.js +1860 -0
  18. package/Build/Workers/chunk-EQ6ZAP37.js +218 -0
  19. package/Build/Workers/chunk-F7P2HCYZ.js +73 -0
  20. package/Build/Workers/chunk-FE2XG3SS.js +73 -0
  21. package/Build/Workers/chunk-FKHRSGKP.js +781 -0
  22. package/Build/Workers/chunk-FVDTKX3F.js +58 -0
  23. package/Build/Workers/chunk-FYHCAKU6.js +684 -0
  24. package/Build/Workers/chunk-G3MOT7BZ.js +157 -0
  25. package/Build/Workers/chunk-H52L6U76.js +421 -0
  26. package/Build/Workers/chunk-H6MBQ4W4.js +305 -0
  27. package/Build/Workers/chunk-HCZR75II.js +2716 -0
  28. package/Build/Workers/chunk-I5MQWHBR.js +102 -0
  29. package/Build/Workers/chunk-KAFF2QX3.js +258 -0
  30. package/Build/Workers/chunk-LGSGX2RH.js +757 -0
  31. package/Build/Workers/chunk-LQRFWCNX.js +124 -0
  32. package/Build/Workers/chunk-N5MMDSD2.js +44 -0
  33. package/Build/Workers/chunk-NRETMGYL.js +390 -0
  34. package/Build/Workers/chunk-P4M4QUNQ.js +196 -0
  35. package/Build/Workers/chunk-P7PWX5HR.js +430 -0
  36. package/Build/Workers/chunk-PGB3EFR7.js +171 -0
  37. package/Build/Workers/chunk-PW5CA4MJ.js +3273 -0
  38. package/Build/Workers/chunk-PWDYKCNC.js +501 -0
  39. package/Build/Workers/chunk-QIS3NB7U.js +1258 -0
  40. package/Build/Workers/chunk-QVJ6IRKV.js +77 -0
  41. package/Build/Workers/chunk-RDCDRNJ7.js +117 -0
  42. package/Build/Workers/chunk-RDM3BKNC.js +1009 -0
  43. package/Build/Workers/chunk-RRUPTJ6P.js +452 -0
  44. package/Build/Workers/chunk-SGRWJKNO.js +400 -0
  45. package/Build/Workers/chunk-TF5D2H7B.js +138 -0
  46. package/Build/Workers/chunk-TVYIHH4V.js +513 -0
  47. package/Build/Workers/chunk-U5LKG6LX.js +101 -0
  48. package/Build/Workers/chunk-UGZGTV5K.js +302 -0
  49. package/Build/Workers/chunk-UN7AK64D.js +163 -0
  50. package/Build/Workers/chunk-V2LKNJGT.js +59 -0
  51. package/Build/Workers/chunk-VSCXSFHE.js +1477 -0
  52. package/Build/Workers/chunk-XJCTFTBM.js +2041 -0
  53. package/Build/Workers/chunk-XZVQMPWG.js +100 -0
  54. package/Build/Workers/chunk-YLAFWVOW.js +834 -0
  55. package/Build/Workers/chunk-YLS3FX3U.js +236 -0
  56. package/Build/Workers/chunk-YMJPANZZ.js +693 -0
  57. package/Build/Workers/combineGeometry.js +65 -15
  58. package/Build/Workers/createBoxGeometry.js +55 -10
  59. package/Build/Workers/createBoxOutlineGeometry.js +231 -310
  60. package/Build/Workers/createCircleGeometry.js +185 -202
  61. package/Build/Workers/createCircleOutlineGeometry.js +141 -155
  62. package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
  63. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  64. package/Build/Workers/createCorridorGeometry.js +1162 -1307
  65. package/Build/Workers/createCorridorOutlineGeometry.js +533 -569
  66. package/Build/Workers/createCylinderGeometry.js +57 -10
  67. package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
  68. package/Build/Workers/createEllipseGeometry.js +68 -12
  69. package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
  70. package/Build/Workers/createEllipsoidGeometry.js +56 -10
  71. package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
  72. package/Build/Workers/createFrustumGeometry.js +55 -10
  73. package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
  74. package/Build/Workers/createGeometry.js +143 -48
  75. package/Build/Workers/createGroundPolylineGeometry.js +1484 -2011
  76. package/Build/Workers/createPlaneGeometry.js +216 -243
  77. package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
  78. package/Build/Workers/createPolygonGeometry.js +1041 -1327
  79. package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
  80. package/Build/Workers/createPolylineGeometry.js +471 -547
  81. package/Build/Workers/createPolylineVolumeGeometry.js +352 -384
  82. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
  83. package/Build/Workers/createRectangleGeometry.js +1128 -1331
  84. package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
  85. package/Build/Workers/createSimplePolylineGeometry.js +381 -440
  86. package/Build/Workers/createSphereGeometry.js +112 -118
  87. package/Build/Workers/createSphereOutlineGeometry.js +112 -121
  88. package/Build/Workers/createTaskProcessorWorker.js +32 -127
  89. package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
  90. package/Build/Workers/createVectorTileGeometries.js +377 -436
  91. package/Build/Workers/createVectorTilePoints.js +110 -77
  92. package/Build/Workers/createVectorTilePolygons.js +369 -391
  93. package/Build/Workers/createVectorTilePolylines.js +252 -244
  94. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  95. package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
  96. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
  97. package/Build/Workers/createWallGeometry.js +459 -593
  98. package/Build/Workers/createWallOutlineGeometry.js +324 -419
  99. package/Build/Workers/decodeDraco.js +327 -347
  100. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  101. package/Build/Workers/decodeI3S.js +765 -970
  102. package/Build/Workers/transcodeKTX2.js +3353 -1464
  103. package/Build/Workers/transferTypedArrayTest.js +3 -4
  104. package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  105. package/LICENSE.md +0 -12
  106. package/Source/Core/FeatureDetection.js +9 -0
  107. package/Source/Core/GoogleMaps.js +1 -1
  108. package/Source/Core/GroundPolylineGeometry.js +3 -2
  109. package/Source/Core/Ion.js +1 -1
  110. package/Source/Core/KTX2Transcoder.js +7 -3
  111. package/Source/Core/RequestScheduler.js +1 -0
  112. package/Source/Core/TaskProcessor.js +150 -146
  113. package/Source/Core/Transforms.js +2 -2
  114. package/Source/Core/buildModuleUrl.js +6 -5
  115. package/Source/DataSources/CzmlDataSource.js +6 -4
  116. package/Source/Scene/ArcGisMapService.js +1 -1
  117. package/Source/Scene/DracoLoader.js +26 -3
  118. package/Source/Scene/GltfLoaderUtil.js +1 -7
  119. package/Source/Scene/I3SDataProvider.js +0 -27
  120. package/Source/Scene/I3SDecoder.js +127 -0
  121. package/Source/Scene/I3SNode.js +32 -110
  122. package/Source/Scene/ImageryLayer.js +2 -2
  123. package/Source/Scene/Implicit3DTileContent.js +13 -0
  124. package/Source/Scene/ImplicitTileset.js +5 -0
  125. package/Source/Scene/Model/I3dmLoader.js +5 -1
  126. package/Source/Scene/Model/Model.js +4 -1
  127. package/Source/Scene/OpenStreetMapImageryProvider.js +7 -4
  128. package/Source/Scene/SingleTileImageryProvider.js +4 -2
  129. package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
  130. package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
  131. package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
  132. package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
  133. package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
  134. package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
  135. package/Source/Workers/transferTypedArrayTest.js +0 -6
  136. package/index.d.ts +20 -11
  137. package/index.js +170 -169
  138. package/package.json +3 -2
  139. package/Build/Workers/ArcType-2d9abbbc.js +0 -37
  140. package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
  141. package/Build/Workers/AxisAlignedBoundingBox-4bfd84f3.js +0 -258
  142. package/Build/Workers/BoundingRectangle-5fd6403a.js +0 -369
  143. package/Build/Workers/BoxGeometry-7aa4ce7f.js +0 -884
  144. package/Build/Workers/Check-6ede7e26.js +0 -290
  145. package/Build/Workers/Color-8e135f71.js +0 -2262
  146. package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  147. package/Build/Workers/CoplanarPolygonGeometryLibrary-59c69b0a.js +0 -132
  148. package/Build/Workers/CorridorGeometryLibrary-63907365.js +0 -498
  149. package/Build/Workers/CylinderGeometry-8fc7c44b.js +0 -467
  150. package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  151. package/Build/Workers/EllipseGeometry-16b3736a.js +0 -1304
  152. package/Build/Workers/EllipseGeometryLibrary-21262a28.js +0 -366
  153. package/Build/Workers/EllipseOutlineGeometry-05d35d18.js +0 -443
  154. package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  155. package/Build/Workers/EllipsoidGeometry-a503d1d6.js +0 -637
  156. package/Build/Workers/EllipsoidOutlineGeometry-7b09f24d.js +0 -454
  157. package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  158. package/Build/Workers/EllipsoidTangentPlane-546c0d5e.js +0 -373
  159. package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
  160. package/Build/Workers/FrustumGeometry-87ce8622.js +0 -2540
  161. package/Build/Workers/GeometryAttribute-8fcff0d5.js +0 -619
  162. package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
  163. package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
  164. package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  165. package/Build/Workers/GeometryPipeline-70d69a43.js +0 -3690
  166. package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
  167. package/Build/Workers/IntersectionTests-85350792.js +0 -1836
  168. package/Build/Workers/Math-0a2ac845.js +0 -1340
  169. package/Build/Workers/Matrix2-e1298525.js +0 -7086
  170. package/Build/Workers/Matrix3-41c58dde.js +0 -4283
  171. package/Build/Workers/OrientedBoundingBox-29fb0fcd.js +0 -1259
  172. package/Build/Workers/Plane-4c3d403b.js +0 -309
  173. package/Build/Workers/PolygonGeometryLibrary-bad6329a.js +0 -1074
  174. package/Build/Workers/PolygonPipeline-dd13ee78.js +0 -1344
  175. package/Build/Workers/PolylinePipeline-7119eb3f.js +0 -573
  176. package/Build/Workers/PolylineVolumeGeometryLibrary-d25f0050.js +0 -781
  177. package/Build/Workers/PrimitivePipeline-111ee29f.js +0 -966
  178. package/Build/Workers/RectangleGeometryLibrary-bb378fb6.js +0 -280
  179. package/Build/Workers/RuntimeError-ef395448.js +0 -68
  180. package/Build/Workers/TerrainEncoding-c8e029a2.js +0 -1227
  181. package/Build/Workers/Transforms-e2d4a55a.js +0 -14713
  182. package/Build/Workers/VertexFormat-030f11ff.js +0 -312
  183. package/Build/Workers/WallGeometryLibrary-3e0819ec.js +0 -211
  184. package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  185. package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  186. package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  187. package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
  188. package/Build/Workers/combine-d9581036.js +0 -82
  189. package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
  190. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  191. package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
  192. package/Source/Workers/package.json +0 -1
  193. /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
  194. /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
  195. /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
  196. /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
  197. /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
  198. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
  199. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
  200. /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
  201. /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
  202. /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
  203. /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
  204. /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
  205. /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
  206. /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
  207. /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
  208. /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
  209. /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
  210. /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
  211. /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
  212. /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
  213. /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
  214. /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
  215. /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
  216. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
  217. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
  218. /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
  219. /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
  220. /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
  221. /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
  222. /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
  223. /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
  224. /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
  225. /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
  226. /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
  227. /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
  228. /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
  229. /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
  230. /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
  231. /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
  232. /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
  233. /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
  234. /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
@@ -1,258 +0,0 @@
1
- define(['exports', './Matrix3-41c58dde', './Check-6ede7e26', './defaultValue-fe22d8c0', './Transforms-e2d4a55a'], (function (exports, Matrix3, Check, defaultValue, Transforms) { 'use strict';
2
-
3
- /**
4
- * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
5
- * @alias AxisAlignedBoundingBox
6
- * @constructor
7
- *
8
- * @param {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes.
9
- * @param {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes.
10
- * @param {Cartesian3} [center] The center of the box; automatically computed if not supplied.
11
- *
12
- * @see BoundingSphere
13
- * @see BoundingRectangle
14
- */
15
- function AxisAlignedBoundingBox(minimum, maximum, center) {
16
- /**
17
- * The minimum point defining the bounding box.
18
- * @type {Cartesian3}
19
- * @default {@link Cartesian3.ZERO}
20
- */
21
- this.minimum = Matrix3.Cartesian3.clone(defaultValue.defaultValue(minimum, Matrix3.Cartesian3.ZERO));
22
-
23
- /**
24
- * The maximum point defining the bounding box.
25
- * @type {Cartesian3}
26
- * @default {@link Cartesian3.ZERO}
27
- */
28
- this.maximum = Matrix3.Cartesian3.clone(defaultValue.defaultValue(maximum, Matrix3.Cartesian3.ZERO));
29
-
30
- // If center was not defined, compute it.
31
- if (!defaultValue.defined(center)) {
32
- center = Matrix3.Cartesian3.midpoint(this.minimum, this.maximum, new Matrix3.Cartesian3());
33
- } else {
34
- center = Matrix3.Cartesian3.clone(center);
35
- }
36
-
37
- /**
38
- * The center point of the bounding box.
39
- * @type {Cartesian3}
40
- */
41
- this.center = center;
42
- }
43
-
44
- /**
45
- * Creates an instance of an AxisAlignedBoundingBox from its corners.
46
- *
47
- * @param {Cartesian3} minimum The minimum point along the x, y, and z axes.
48
- * @param {Cartesian3} maximum The maximum point along the x, y, and z axes.
49
- * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
50
- * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
51
- *
52
- * @example
53
- * // Compute an axis aligned bounding box from the two corners.
54
- * const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));
55
- */
56
- AxisAlignedBoundingBox.fromCorners = function (minimum, maximum, result) {
57
- //>>includeStart('debug', pragmas.debug);
58
- Check.Check.defined("minimum", minimum);
59
- Check.Check.defined("maximum", maximum);
60
- //>>includeEnd('debug');
61
-
62
- if (!defaultValue.defined(result)) {
63
- result = new AxisAlignedBoundingBox();
64
- }
65
-
66
- result.minimum = Matrix3.Cartesian3.clone(minimum, result.minimum);
67
- result.maximum = Matrix3.Cartesian3.clone(maximum, result.maximum);
68
- result.center = Matrix3.Cartesian3.midpoint(minimum, maximum, result.center);
69
-
70
- return result;
71
- };
72
-
73
- /**
74
- * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
75
- * finding the points spaced the farthest apart on the x, y, and z axes.
76
- *
77
- * @param {Cartesian3[]} positions List of points that the bounding box will enclose. Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.
78
- * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
79
- * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
80
- *
81
- * @example
82
- * // Compute an axis aligned bounding box enclosing two points.
83
- * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
84
- */
85
- AxisAlignedBoundingBox.fromPoints = function (positions, result) {
86
- if (!defaultValue.defined(result)) {
87
- result = new AxisAlignedBoundingBox();
88
- }
89
-
90
- if (!defaultValue.defined(positions) || positions.length === 0) {
91
- result.minimum = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.minimum);
92
- result.maximum = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.maximum);
93
- result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
94
- return result;
95
- }
96
-
97
- let minimumX = positions[0].x;
98
- let minimumY = positions[0].y;
99
- let minimumZ = positions[0].z;
100
-
101
- let maximumX = positions[0].x;
102
- let maximumY = positions[0].y;
103
- let maximumZ = positions[0].z;
104
-
105
- const length = positions.length;
106
- for (let i = 1; i < length; i++) {
107
- const p = positions[i];
108
- const x = p.x;
109
- const y = p.y;
110
- const z = p.z;
111
-
112
- minimumX = Math.min(x, minimumX);
113
- maximumX = Math.max(x, maximumX);
114
- minimumY = Math.min(y, minimumY);
115
- maximumY = Math.max(y, maximumY);
116
- minimumZ = Math.min(z, minimumZ);
117
- maximumZ = Math.max(z, maximumZ);
118
- }
119
-
120
- const minimum = result.minimum;
121
- minimum.x = minimumX;
122
- minimum.y = minimumY;
123
- minimum.z = minimumZ;
124
-
125
- const maximum = result.maximum;
126
- maximum.x = maximumX;
127
- maximum.y = maximumY;
128
- maximum.z = maximumZ;
129
-
130
- result.center = Matrix3.Cartesian3.midpoint(minimum, maximum, result.center);
131
-
132
- return result;
133
- };
134
-
135
- /**
136
- * Duplicates a AxisAlignedBoundingBox instance.
137
- *
138
- * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.
139
- * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
140
- * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
141
- */
142
- AxisAlignedBoundingBox.clone = function (box, result) {
143
- if (!defaultValue.defined(box)) {
144
- return undefined;
145
- }
146
-
147
- if (!defaultValue.defined(result)) {
148
- return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);
149
- }
150
-
151
- result.minimum = Matrix3.Cartesian3.clone(box.minimum, result.minimum);
152
- result.maximum = Matrix3.Cartesian3.clone(box.maximum, result.maximum);
153
- result.center = Matrix3.Cartesian3.clone(box.center, result.center);
154
- return result;
155
- };
156
-
157
- /**
158
- * Compares the provided AxisAlignedBoundingBox componentwise and returns
159
- * <code>true</code> if they are equal, <code>false</code> otherwise.
160
- *
161
- * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.
162
- * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.
163
- * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
164
- */
165
- AxisAlignedBoundingBox.equals = function (left, right) {
166
- return (
167
- left === right ||
168
- (defaultValue.defined(left) &&
169
- defaultValue.defined(right) &&
170
- Matrix3.Cartesian3.equals(left.center, right.center) &&
171
- Matrix3.Cartesian3.equals(left.minimum, right.minimum) &&
172
- Matrix3.Cartesian3.equals(left.maximum, right.maximum))
173
- );
174
- };
175
-
176
- let intersectScratch = new Matrix3.Cartesian3();
177
- /**
178
- * Determines which side of a plane a box is located.
179
- *
180
- * @param {AxisAlignedBoundingBox} box The bounding box to test.
181
- * @param {Plane} plane The plane to test against.
182
- * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
183
- * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
184
- * on the opposite side, and {@link Intersect.INTERSECTING} if the box
185
- * intersects the plane.
186
- */
187
- AxisAlignedBoundingBox.intersectPlane = function (box, plane) {
188
- //>>includeStart('debug', pragmas.debug);
189
- Check.Check.defined("box", box);
190
- Check.Check.defined("plane", plane);
191
- //>>includeEnd('debug');
192
-
193
- intersectScratch = Matrix3.Cartesian3.subtract(
194
- box.maximum,
195
- box.minimum,
196
- intersectScratch
197
- );
198
- const h = Matrix3.Cartesian3.multiplyByScalar(
199
- intersectScratch,
200
- 0.5,
201
- intersectScratch
202
- ); //The positive half diagonal
203
- const normal = plane.normal;
204
- const e =
205
- h.x * Math.abs(normal.x) +
206
- h.y * Math.abs(normal.y) +
207
- h.z * Math.abs(normal.z);
208
- const s = Matrix3.Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center
209
-
210
- if (s - e > 0) {
211
- return Transforms.Intersect.INSIDE;
212
- }
213
-
214
- if (s + e < 0) {
215
- //Not in front because normals point inward
216
- return Transforms.Intersect.OUTSIDE;
217
- }
218
-
219
- return Transforms.Intersect.INTERSECTING;
220
- };
221
-
222
- /**
223
- * Duplicates this AxisAlignedBoundingBox instance.
224
- *
225
- * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
226
- * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
227
- */
228
- AxisAlignedBoundingBox.prototype.clone = function (result) {
229
- return AxisAlignedBoundingBox.clone(this, result);
230
- };
231
-
232
- /**
233
- * Determines which side of a plane this box is located.
234
- *
235
- * @param {Plane} plane The plane to test against.
236
- * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
237
- * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
238
- * on the opposite side, and {@link Intersect.INTERSECTING} if the box
239
- * intersects the plane.
240
- */
241
- AxisAlignedBoundingBox.prototype.intersectPlane = function (plane) {
242
- return AxisAlignedBoundingBox.intersectPlane(this, plane);
243
- };
244
-
245
- /**
246
- * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
247
- * <code>true</code> if they are equal, <code>false</code> otherwise.
248
- *
249
- * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.
250
- * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
251
- */
252
- AxisAlignedBoundingBox.prototype.equals = function (right) {
253
- return AxisAlignedBoundingBox.equals(this, right);
254
- };
255
-
256
- exports.AxisAlignedBoundingBox = AxisAlignedBoundingBox;
257
-
258
- }));
@@ -1,369 +0,0 @@
1
- define(['exports', './Matrix2-e1298525', './Matrix3-41c58dde', './Check-6ede7e26', './defaultValue-fe22d8c0', './Transforms-e2d4a55a'], (function (exports, Matrix2, Matrix3, Check, defaultValue, Transforms) { 'use strict';
2
-
3
- /**
4
- * A bounding rectangle given by a corner, width and height.
5
- * @alias BoundingRectangle
6
- * @constructor
7
- *
8
- * @param {number} [x=0.0] The x coordinate of the rectangle.
9
- * @param {number} [y=0.0] The y coordinate of the rectangle.
10
- * @param {number} [width=0.0] The width of the rectangle.
11
- * @param {number} [height=0.0] The height of the rectangle.
12
- *
13
- * @see BoundingSphere
14
- * @see Packable
15
- */
16
- function BoundingRectangle(x, y, width, height) {
17
- /**
18
- * The x coordinate of the rectangle.
19
- * @type {number}
20
- * @default 0.0
21
- */
22
- this.x = defaultValue.defaultValue(x, 0.0);
23
-
24
- /**
25
- * The y coordinate of the rectangle.
26
- * @type {number}
27
- * @default 0.0
28
- */
29
- this.y = defaultValue.defaultValue(y, 0.0);
30
-
31
- /**
32
- * The width of the rectangle.
33
- * @type {number}
34
- * @default 0.0
35
- */
36
- this.width = defaultValue.defaultValue(width, 0.0);
37
-
38
- /**
39
- * The height of the rectangle.
40
- * @type {number}
41
- * @default 0.0
42
- */
43
- this.height = defaultValue.defaultValue(height, 0.0);
44
- }
45
-
46
- /**
47
- * The number of elements used to pack the object into an array.
48
- * @type {number}
49
- */
50
- BoundingRectangle.packedLength = 4;
51
-
52
- /**
53
- * Stores the provided instance into the provided array.
54
- *
55
- * @param {BoundingRectangle} value The value to pack.
56
- * @param {number[]} array The array to pack into.
57
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
58
- *
59
- * @returns {number[]} The array that was packed into
60
- */
61
- BoundingRectangle.pack = function (value, array, startingIndex) {
62
- //>>includeStart('debug', pragmas.debug);
63
- Check.Check.typeOf.object("value", value);
64
- Check.Check.defined("array", array);
65
- //>>includeEnd('debug');
66
-
67
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
68
-
69
- array[startingIndex++] = value.x;
70
- array[startingIndex++] = value.y;
71
- array[startingIndex++] = value.width;
72
- array[startingIndex] = value.height;
73
-
74
- return array;
75
- };
76
-
77
- /**
78
- * Retrieves an instance from a packed array.
79
- *
80
- * @param {number[]} array The packed array.
81
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
82
- * @param {BoundingRectangle} [result] The object into which to store the result.
83
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
84
- */
85
- BoundingRectangle.unpack = function (array, startingIndex, result) {
86
- //>>includeStart('debug', pragmas.debug);
87
- Check.Check.defined("array", array);
88
- //>>includeEnd('debug');
89
-
90
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
91
-
92
- if (!defaultValue.defined(result)) {
93
- result = new BoundingRectangle();
94
- }
95
- result.x = array[startingIndex++];
96
- result.y = array[startingIndex++];
97
- result.width = array[startingIndex++];
98
- result.height = array[startingIndex];
99
- return result;
100
- };
101
-
102
- /**
103
- * Computes a bounding rectangle enclosing the list of 2D points.
104
- * The rectangle is oriented with the corner at the bottom left.
105
- *
106
- * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.
107
- * @param {BoundingRectangle} [result] The object onto which to store the result.
108
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
109
- */
110
- BoundingRectangle.fromPoints = function (positions, result) {
111
- if (!defaultValue.defined(result)) {
112
- result = new BoundingRectangle();
113
- }
114
-
115
- if (!defaultValue.defined(positions) || positions.length === 0) {
116
- result.x = 0;
117
- result.y = 0;
118
- result.width = 0;
119
- result.height = 0;
120
- return result;
121
- }
122
-
123
- const length = positions.length;
124
-
125
- let minimumX = positions[0].x;
126
- let minimumY = positions[0].y;
127
-
128
- let maximumX = positions[0].x;
129
- let maximumY = positions[0].y;
130
-
131
- for (let i = 1; i < length; i++) {
132
- const p = positions[i];
133
- const x = p.x;
134
- const y = p.y;
135
-
136
- minimumX = Math.min(x, minimumX);
137
- maximumX = Math.max(x, maximumX);
138
- minimumY = Math.min(y, minimumY);
139
- maximumY = Math.max(y, maximumY);
140
- }
141
-
142
- result.x = minimumX;
143
- result.y = minimumY;
144
- result.width = maximumX - minimumX;
145
- result.height = maximumY - minimumY;
146
- return result;
147
- };
148
-
149
- const defaultProjection = new Transforms.GeographicProjection();
150
- const fromRectangleLowerLeft = new Matrix3.Cartographic();
151
- const fromRectangleUpperRight = new Matrix3.Cartographic();
152
- /**
153
- * Computes a bounding rectangle from a rectangle.
154
- *
155
- * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.
156
- * @param {object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
157
- * @param {BoundingRectangle} [result] The object onto which to store the result.
158
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
159
- */
160
- BoundingRectangle.fromRectangle = function (rectangle, projection, result) {
161
- if (!defaultValue.defined(result)) {
162
- result = new BoundingRectangle();
163
- }
164
-
165
- if (!defaultValue.defined(rectangle)) {
166
- result.x = 0;
167
- result.y = 0;
168
- result.width = 0;
169
- result.height = 0;
170
- return result;
171
- }
172
-
173
- projection = defaultValue.defaultValue(projection, defaultProjection);
174
-
175
- const lowerLeft = projection.project(
176
- Matrix2.Rectangle.southwest(rectangle, fromRectangleLowerLeft)
177
- );
178
- const upperRight = projection.project(
179
- Matrix2.Rectangle.northeast(rectangle, fromRectangleUpperRight)
180
- );
181
-
182
- Matrix2.Cartesian2.subtract(upperRight, lowerLeft, upperRight);
183
-
184
- result.x = lowerLeft.x;
185
- result.y = lowerLeft.y;
186
- result.width = upperRight.x;
187
- result.height = upperRight.y;
188
- return result;
189
- };
190
-
191
- /**
192
- * Duplicates a BoundingRectangle instance.
193
- *
194
- * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.
195
- * @param {BoundingRectangle} [result] The object onto which to store the result.
196
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
197
- */
198
- BoundingRectangle.clone = function (rectangle, result) {
199
- if (!defaultValue.defined(rectangle)) {
200
- return undefined;
201
- }
202
-
203
- if (!defaultValue.defined(result)) {
204
- return new BoundingRectangle(
205
- rectangle.x,
206
- rectangle.y,
207
- rectangle.width,
208
- rectangle.height
209
- );
210
- }
211
-
212
- result.x = rectangle.x;
213
- result.y = rectangle.y;
214
- result.width = rectangle.width;
215
- result.height = rectangle.height;
216
- return result;
217
- };
218
-
219
- /**
220
- * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
221
- *
222
- * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.
223
- * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.
224
- * @param {BoundingRectangle} [result] The object onto which to store the result.
225
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
226
- */
227
- BoundingRectangle.union = function (left, right, result) {
228
- //>>includeStart('debug', pragmas.debug);
229
- Check.Check.typeOf.object("left", left);
230
- Check.Check.typeOf.object("right", right);
231
- //>>includeEnd('debug');
232
-
233
- if (!defaultValue.defined(result)) {
234
- result = new BoundingRectangle();
235
- }
236
-
237
- const lowerLeftX = Math.min(left.x, right.x);
238
- const lowerLeftY = Math.min(left.y, right.y);
239
- const upperRightX = Math.max(left.x + left.width, right.x + right.width);
240
- const upperRightY = Math.max(left.y + left.height, right.y + right.height);
241
-
242
- result.x = lowerLeftX;
243
- result.y = lowerLeftY;
244
- result.width = upperRightX - lowerLeftX;
245
- result.height = upperRightY - lowerLeftY;
246
- return result;
247
- };
248
-
249
- /**
250
- * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
251
- *
252
- * @param {BoundingRectangle} rectangle A rectangle to expand.
253
- * @param {Cartesian2} point A point to enclose in a bounding rectangle.
254
- * @param {BoundingRectangle} [result] The object onto which to store the result.
255
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
256
- */
257
- BoundingRectangle.expand = function (rectangle, point, result) {
258
- //>>includeStart('debug', pragmas.debug);
259
- Check.Check.typeOf.object("rectangle", rectangle);
260
- Check.Check.typeOf.object("point", point);
261
- //>>includeEnd('debug');
262
-
263
- result = BoundingRectangle.clone(rectangle, result);
264
-
265
- const width = point.x - result.x;
266
- const height = point.y - result.y;
267
-
268
- if (width > result.width) {
269
- result.width = width;
270
- } else if (width < 0) {
271
- result.width -= width;
272
- result.x = point.x;
273
- }
274
-
275
- if (height > result.height) {
276
- result.height = height;
277
- } else if (height < 0) {
278
- result.height -= height;
279
- result.y = point.y;
280
- }
281
-
282
- return result;
283
- };
284
-
285
- /**
286
- * Determines if two rectangles intersect.
287
- *
288
- * @param {BoundingRectangle} left A rectangle to check for intersection.
289
- * @param {BoundingRectangle} right The other rectangle to check for intersection.
290
- * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
291
- */
292
- BoundingRectangle.intersect = function (left, right) {
293
- //>>includeStart('debug', pragmas.debug);
294
- Check.Check.typeOf.object("left", left);
295
- Check.Check.typeOf.object("right", right);
296
- //>>includeEnd('debug');
297
-
298
- const leftX = left.x;
299
- const leftY = left.y;
300
- const rightX = right.x;
301
- const rightY = right.y;
302
- if (
303
- !(
304
- leftX > rightX + right.width ||
305
- leftX + left.width < rightX ||
306
- leftY + left.height < rightY ||
307
- leftY > rightY + right.height
308
- )
309
- ) {
310
- return Transforms.Intersect.INTERSECTING;
311
- }
312
-
313
- return Transforms.Intersect.OUTSIDE;
314
- };
315
-
316
- /**
317
- * Compares the provided BoundingRectangles componentwise and returns
318
- * <code>true</code> if they are equal, <code>false</code> otherwise.
319
- *
320
- * @param {BoundingRectangle} [left] The first BoundingRectangle.
321
- * @param {BoundingRectangle} [right] The second BoundingRectangle.
322
- * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
323
- */
324
- BoundingRectangle.equals = function (left, right) {
325
- return (
326
- left === right ||
327
- (defaultValue.defined(left) &&
328
- defaultValue.defined(right) &&
329
- left.x === right.x &&
330
- left.y === right.y &&
331
- left.width === right.width &&
332
- left.height === right.height)
333
- );
334
- };
335
-
336
- /**
337
- * Duplicates this BoundingRectangle instance.
338
- *
339
- * @param {BoundingRectangle} [result] The object onto which to store the result.
340
- * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
341
- */
342
- BoundingRectangle.prototype.clone = function (result) {
343
- return BoundingRectangle.clone(this, result);
344
- };
345
-
346
- /**
347
- * Determines if this rectangle intersects with another.
348
- *
349
- * @param {BoundingRectangle} right A rectangle to check for intersection.
350
- * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
351
- */
352
- BoundingRectangle.prototype.intersect = function (right) {
353
- return BoundingRectangle.intersect(this, right);
354
- };
355
-
356
- /**
357
- * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
358
- * <code>true</code> if they are equal, <code>false</code> otherwise.
359
- *
360
- * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.
361
- * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
362
- */
363
- BoundingRectangle.prototype.equals = function (right) {
364
- return BoundingRectangle.equals(this, right);
365
- };
366
-
367
- exports.BoundingRectangle = BoundingRectangle;
368
-
369
- }));