@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,373 +0,0 @@
1
- define(['exports', './AxisAlignedBoundingBox-4bfd84f3', './Matrix2-e1298525', './Matrix3-41c58dde', './Check-6ede7e26', './defaultValue-fe22d8c0', './IntersectionTests-85350792', './Plane-4c3d403b', './Transforms-e2d4a55a'], (function (exports, AxisAlignedBoundingBox, Matrix2, Matrix3, Check, defaultValue, IntersectionTests, Plane, Transforms) { 'use strict';
2
-
3
- const scratchCart4 = new Matrix2.Cartesian4();
4
- /**
5
- * A plane tangent to the provided ellipsoid at the provided origin.
6
- * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
7
- * If origin is at the center of the ellipsoid, an exception will be thrown.
8
- * @alias EllipsoidTangentPlane
9
- * @constructor
10
- *
11
- * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.
12
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
13
- *
14
- * @exception {DeveloperError} origin must not be at the center of the ellipsoid.
15
- */
16
- function EllipsoidTangentPlane(origin, ellipsoid) {
17
- //>>includeStart('debug', pragmas.debug);
18
- Check.Check.defined("origin", origin);
19
- //>>includeEnd('debug');
20
-
21
- ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
22
- origin = ellipsoid.scaleToGeodeticSurface(origin);
23
-
24
- //>>includeStart('debug', pragmas.debug);
25
- if (!defaultValue.defined(origin)) {
26
- throw new Check.DeveloperError(
27
- "origin must not be at the center of the ellipsoid."
28
- );
29
- }
30
- //>>includeEnd('debug');
31
-
32
- const eastNorthUp = Transforms.Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);
33
- this._ellipsoid = ellipsoid;
34
- this._origin = origin;
35
- this._xAxis = Matrix3.Cartesian3.fromCartesian4(
36
- Matrix2.Matrix4.getColumn(eastNorthUp, 0, scratchCart4)
37
- );
38
- this._yAxis = Matrix3.Cartesian3.fromCartesian4(
39
- Matrix2.Matrix4.getColumn(eastNorthUp, 1, scratchCart4)
40
- );
41
-
42
- const normal = Matrix3.Cartesian3.fromCartesian4(
43
- Matrix2.Matrix4.getColumn(eastNorthUp, 2, scratchCart4)
44
- );
45
- this._plane = Plane.Plane.fromPointNormal(origin, normal);
46
- }
47
-
48
- Object.defineProperties(EllipsoidTangentPlane.prototype, {
49
- /**
50
- * Gets the ellipsoid.
51
- * @memberof EllipsoidTangentPlane.prototype
52
- * @type {Ellipsoid}
53
- */
54
- ellipsoid: {
55
- get: function () {
56
- return this._ellipsoid;
57
- },
58
- },
59
-
60
- /**
61
- * Gets the origin.
62
- * @memberof EllipsoidTangentPlane.prototype
63
- * @type {Cartesian3}
64
- */
65
- origin: {
66
- get: function () {
67
- return this._origin;
68
- },
69
- },
70
-
71
- /**
72
- * Gets the plane which is tangent to the ellipsoid.
73
- * @memberof EllipsoidTangentPlane.prototype
74
- * @readonly
75
- * @type {Plane}
76
- */
77
- plane: {
78
- get: function () {
79
- return this._plane;
80
- },
81
- },
82
-
83
- /**
84
- * Gets the local X-axis (east) of the tangent plane.
85
- * @memberof EllipsoidTangentPlane.prototype
86
- * @readonly
87
- * @type {Cartesian3}
88
- */
89
- xAxis: {
90
- get: function () {
91
- return this._xAxis;
92
- },
93
- },
94
-
95
- /**
96
- * Gets the local Y-axis (north) of the tangent plane.
97
- * @memberof EllipsoidTangentPlane.prototype
98
- * @readonly
99
- * @type {Cartesian3}
100
- */
101
- yAxis: {
102
- get: function () {
103
- return this._yAxis;
104
- },
105
- },
106
-
107
- /**
108
- * Gets the local Z-axis (up) of the tangent plane.
109
- * @memberof EllipsoidTangentPlane.prototype
110
- * @readonly
111
- * @type {Cartesian3}
112
- */
113
- zAxis: {
114
- get: function () {
115
- return this._plane.normal;
116
- },
117
- },
118
- });
119
-
120
- const tmp = new AxisAlignedBoundingBox.AxisAlignedBoundingBox();
121
- /**
122
- * Creates a new instance from the provided ellipsoid and the center
123
- * point of the provided Cartesians.
124
- *
125
- * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.
126
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
127
- * @returns {EllipsoidTangentPlane} The new instance of EllipsoidTangentPlane.
128
- */
129
- EllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {
130
- //>>includeStart('debug', pragmas.debug);
131
- Check.Check.defined("cartesians", cartesians);
132
- //>>includeEnd('debug');
133
-
134
- const box = AxisAlignedBoundingBox.AxisAlignedBoundingBox.fromPoints(cartesians, tmp);
135
- return new EllipsoidTangentPlane(box.center, ellipsoid);
136
- };
137
-
138
- const scratchProjectPointOntoPlaneRay = new IntersectionTests.Ray();
139
- const scratchProjectPointOntoPlaneCartesian3 = new Matrix3.Cartesian3();
140
-
141
- /**
142
- * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
143
- *
144
- * @param {Cartesian3} cartesian The point to project.
145
- * @param {Cartesian2} [result] The object onto which to store the result.
146
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
147
- */
148
- EllipsoidTangentPlane.prototype.projectPointOntoPlane = function (
149
- cartesian,
150
- result
151
- ) {
152
- //>>includeStart('debug', pragmas.debug);
153
- Check.Check.defined("cartesian", cartesian);
154
- //>>includeEnd('debug');
155
-
156
- const ray = scratchProjectPointOntoPlaneRay;
157
- ray.origin = cartesian;
158
- Matrix3.Cartesian3.normalize(cartesian, ray.direction);
159
-
160
- let intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
161
- ray,
162
- this._plane,
163
- scratchProjectPointOntoPlaneCartesian3
164
- );
165
- if (!defaultValue.defined(intersectionPoint)) {
166
- Matrix3.Cartesian3.negate(ray.direction, ray.direction);
167
- intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
168
- ray,
169
- this._plane,
170
- scratchProjectPointOntoPlaneCartesian3
171
- );
172
- }
173
-
174
- if (defaultValue.defined(intersectionPoint)) {
175
- const v = Matrix3.Cartesian3.subtract(
176
- intersectionPoint,
177
- this._origin,
178
- intersectionPoint
179
- );
180
- const x = Matrix3.Cartesian3.dot(this._xAxis, v);
181
- const y = Matrix3.Cartesian3.dot(this._yAxis, v);
182
-
183
- if (!defaultValue.defined(result)) {
184
- return new Matrix2.Cartesian2(x, y);
185
- }
186
- result.x = x;
187
- result.y = y;
188
- return result;
189
- }
190
- return undefined;
191
- };
192
-
193
- /**
194
- * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
195
- * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
196
- *
197
- * @see EllipsoidTangentPlane.projectPointOntoPlane
198
- *
199
- * @param {Cartesian3[]} cartesians The array of points to project.
200
- * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
201
- * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.
202
- */
203
- EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function (
204
- cartesians,
205
- result
206
- ) {
207
- //>>includeStart('debug', pragmas.debug);
208
- Check.Check.defined("cartesians", cartesians);
209
- //>>includeEnd('debug');
210
-
211
- if (!defaultValue.defined(result)) {
212
- result = [];
213
- }
214
-
215
- let count = 0;
216
- const length = cartesians.length;
217
- for (let i = 0; i < length; i++) {
218
- const p = this.projectPointOntoPlane(cartesians[i], result[count]);
219
- if (defaultValue.defined(p)) {
220
- result[count] = p;
221
- count++;
222
- }
223
- }
224
- result.length = count;
225
- return result;
226
- };
227
-
228
- /**
229
- * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
230
- *
231
- * @param {Cartesian3} cartesian The point to project.
232
- * @param {Cartesian2} [result] The object onto which to store the result.
233
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.
234
- */
235
- EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function (
236
- cartesian,
237
- result
238
- ) {
239
- //>>includeStart('debug', pragmas.debug);
240
- Check.Check.defined("cartesian", cartesian);
241
- //>>includeEnd('debug');
242
-
243
- if (!defaultValue.defined(result)) {
244
- result = new Matrix2.Cartesian2();
245
- }
246
-
247
- const ray = scratchProjectPointOntoPlaneRay;
248
- ray.origin = cartesian;
249
- Matrix3.Cartesian3.clone(this._plane.normal, ray.direction);
250
-
251
- let intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
252
- ray,
253
- this._plane,
254
- scratchProjectPointOntoPlaneCartesian3
255
- );
256
- if (!defaultValue.defined(intersectionPoint)) {
257
- Matrix3.Cartesian3.negate(ray.direction, ray.direction);
258
- intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
259
- ray,
260
- this._plane,
261
- scratchProjectPointOntoPlaneCartesian3
262
- );
263
- }
264
-
265
- const v = Matrix3.Cartesian3.subtract(
266
- intersectionPoint,
267
- this._origin,
268
- intersectionPoint
269
- );
270
- const x = Matrix3.Cartesian3.dot(this._xAxis, v);
271
- const y = Matrix3.Cartesian3.dot(this._yAxis, v);
272
-
273
- result.x = x;
274
- result.y = y;
275
- return result;
276
- };
277
-
278
- /**
279
- * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
280
- *
281
- * @see EllipsoidTangentPlane.projectPointToNearestOnPlane
282
- *
283
- * @param {Cartesian3[]} cartesians The array of points to project.
284
- * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
285
- * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>.
286
- */
287
- EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function (
288
- cartesians,
289
- result
290
- ) {
291
- //>>includeStart('debug', pragmas.debug);
292
- Check.Check.defined("cartesians", cartesians);
293
- //>>includeEnd('debug');
294
-
295
- if (!defaultValue.defined(result)) {
296
- result = [];
297
- }
298
-
299
- const length = cartesians.length;
300
- result.length = length;
301
- for (let i = 0; i < length; i++) {
302
- result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
303
- }
304
- return result;
305
- };
306
-
307
- const projectPointsOntoEllipsoidScratch = new Matrix3.Cartesian3();
308
- /**
309
- * Computes the projection of the provided 2D position onto the 3D ellipsoid.
310
- *
311
- * @param {Cartesian2} cartesian The points to project.
312
- * @param {Cartesian3} [result] The Cartesian3 instance to store result.
313
- * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
314
- */
315
- EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function (
316
- cartesian,
317
- result
318
- ) {
319
- //>>includeStart('debug', pragmas.debug);
320
- Check.Check.defined("cartesian", cartesian);
321
- //>>includeEnd('debug');
322
-
323
- if (!defaultValue.defined(result)) {
324
- result = new Matrix3.Cartesian3();
325
- }
326
-
327
- const ellipsoid = this._ellipsoid;
328
- const origin = this._origin;
329
- const xAxis = this._xAxis;
330
- const yAxis = this._yAxis;
331
- const tmp = projectPointsOntoEllipsoidScratch;
332
-
333
- Matrix3.Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);
334
- result = Matrix3.Cartesian3.add(origin, tmp, result);
335
- Matrix3.Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);
336
- Matrix3.Cartesian3.add(result, tmp, result);
337
- ellipsoid.scaleToGeocentricSurface(result, result);
338
-
339
- return result;
340
- };
341
-
342
- /**
343
- * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
344
- *
345
- * @param {Cartesian2[]} cartesians The array of points to project.
346
- * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.
347
- * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.
348
- */
349
- EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function (
350
- cartesians,
351
- result
352
- ) {
353
- //>>includeStart('debug', pragmas.debug);
354
- Check.Check.defined("cartesians", cartesians);
355
- //>>includeEnd('debug');
356
-
357
- const length = cartesians.length;
358
- if (!defaultValue.defined(result)) {
359
- result = new Array(length);
360
- } else {
361
- result.length = length;
362
- }
363
-
364
- for (let i = 0; i < length; ++i) {
365
- result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
366
- }
367
-
368
- return result;
369
- };
370
-
371
- exports.EllipsoidTangentPlane = EllipsoidTangentPlane;
372
-
373
- }));
@@ -1,171 +0,0 @@
1
- define(['exports', './Matrix3-41c58dde', './Check-6ede7e26', './defaultValue-fe22d8c0'], (function (exports, Matrix3, Check, defaultValue) { 'use strict';
2
-
3
- /**
4
- * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}
5
- * values that, when converted to 32-bit floating-point and added, approximate the original input.
6
- * <p>
7
- * This is used to encode positions in vertex buffers for rendering without jittering artifacts
8
- * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
9
- * </p>
10
- *
11
- * @alias EncodedCartesian3
12
- * @constructor
13
- *
14
- * @private
15
- */
16
- function EncodedCartesian3() {
17
- /**
18
- * The high bits for each component. Bits 0 to 22 store the whole value. Bits 23 to 31 are not used.
19
- *
20
- * @type {Cartesian3}
21
- * @default {@link Cartesian3.ZERO}
22
- */
23
- this.high = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO);
24
-
25
- /**
26
- * The low bits for each component. Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction. Bits 23 to 31 are not used.
27
- *
28
- * @type {Cartesian3}
29
- * @default {@link Cartesian3.ZERO}
30
- */
31
- this.low = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO);
32
- }
33
-
34
- /**
35
- * Encodes a 64-bit floating-point value as two floating-point values that, when converted to
36
- * 32-bit floating-point and added, approximate the original input. The returned object
37
- * has <code>high</code> and <code>low</code> properties for the high and low bits, respectively.
38
- * <p>
39
- * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
40
- * </p>
41
- *
42
- * @param {number} value The floating-point value to encode.
43
- * @param {object} [result] The object onto which to store the result.
44
- * @returns {object} The modified result parameter or a new instance if one was not provided.
45
- *
46
- * @example
47
- * const value = 1234567.1234567;
48
- * const splitValue = Cesium.EncodedCartesian3.encode(value);
49
- */
50
- EncodedCartesian3.encode = function (value, result) {
51
- //>>includeStart('debug', pragmas.debug);
52
- Check.Check.typeOf.number("value", value);
53
- //>>includeEnd('debug');
54
-
55
- if (!defaultValue.defined(result)) {
56
- result = {
57
- high: 0.0,
58
- low: 0.0,
59
- };
60
- }
61
-
62
- let doubleHigh;
63
- if (value >= 0.0) {
64
- doubleHigh = Math.floor(value / 65536.0) * 65536.0;
65
- result.high = doubleHigh;
66
- result.low = value - doubleHigh;
67
- } else {
68
- doubleHigh = Math.floor(-value / 65536.0) * 65536.0;
69
- result.high = -doubleHigh;
70
- result.low = value + doubleHigh;
71
- }
72
-
73
- return result;
74
- };
75
-
76
- const scratchEncode = {
77
- high: 0.0,
78
- low: 0.0,
79
- };
80
-
81
- /**
82
- * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3}
83
- * values that, when converted to 32-bit floating-point and added, approximate the original input.
84
- * <p>
85
- * The fixed-point encoding follows {@link https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
86
- * </p>
87
- *
88
- * @param {Cartesian3} cartesian The cartesian to encode.
89
- * @param {EncodedCartesian3} [result] The object onto which to store the result.
90
- * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided.
91
- *
92
- * @example
93
- * const cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0);
94
- * const encoded = Cesium.EncodedCartesian3.fromCartesian(cart);
95
- */
96
- EncodedCartesian3.fromCartesian = function (cartesian, result) {
97
- //>>includeStart('debug', pragmas.debug);
98
- Check.Check.typeOf.object("cartesian", cartesian);
99
- //>>includeEnd('debug');
100
-
101
- if (!defaultValue.defined(result)) {
102
- result = new EncodedCartesian3();
103
- }
104
-
105
- const high = result.high;
106
- const low = result.low;
107
-
108
- EncodedCartesian3.encode(cartesian.x, scratchEncode);
109
- high.x = scratchEncode.high;
110
- low.x = scratchEncode.low;
111
-
112
- EncodedCartesian3.encode(cartesian.y, scratchEncode);
113
- high.y = scratchEncode.high;
114
- low.y = scratchEncode.low;
115
-
116
- EncodedCartesian3.encode(cartesian.z, scratchEncode);
117
- high.z = scratchEncode.high;
118
- low.z = scratchEncode.low;
119
-
120
- return result;
121
- };
122
-
123
- const encodedP = new EncodedCartesian3();
124
-
125
- /**
126
- * Encodes the provided <code>cartesian</code>, and writes it to an array with <code>high</code>
127
- * components followed by <code>low</code> components, i.e. <code>[high.x, high.y, high.z, low.x, low.y, low.z]</code>.
128
- * <p>
129
- * This is used to create interleaved high-precision position vertex attributes.
130
- * </p>
131
- *
132
- * @param {Cartesian3} cartesian The cartesian to encode.
133
- * @param {number[]} cartesianArray The array to write to.
134
- * @param {number} index The index into the array to start writing. Six elements will be written.
135
- *
136
- * @exception {DeveloperError} index must be a number greater than or equal to 0.
137
- *
138
- * @example
139
- * const positions = [
140
- * new Cesium.Cartesian3(),
141
- * // ...
142
- * ];
143
- * const encodedPositions = new Float32Array(2 * 3 * positions.length);
144
- * let j = 0;
145
- * for (let i = 0; i < positions.length; ++i) {
146
- * Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j);
147
- * j += 6;
148
- * }
149
- */
150
- EncodedCartesian3.writeElements = function (cartesian, cartesianArray, index) {
151
- //>>includeStart('debug', pragmas.debug);
152
- Check.Check.defined("cartesianArray", cartesianArray);
153
- Check.Check.typeOf.number("index", index);
154
- Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
155
- //>>includeEnd('debug');
156
-
157
- EncodedCartesian3.fromCartesian(cartesian, encodedP);
158
- const high = encodedP.high;
159
- const low = encodedP.low;
160
-
161
- cartesianArray[index] = high.x;
162
- cartesianArray[index + 1] = high.y;
163
- cartesianArray[index + 2] = high.z;
164
- cartesianArray[index + 3] = low.x;
165
- cartesianArray[index + 4] = low.y;
166
- cartesianArray[index + 5] = low.z;
167
- };
168
-
169
- exports.EncodedCartesian3 = EncodedCartesian3;
170
-
171
- }));