qd-changjing/public/static/Build/CesiumUnminified/Workers/EllipsoidTangentPlane-f1a69...

1 line
20 KiB
Plaintext
Raw Normal View History

2022-07-05 16:56:29 +08:00
{"version":3,"file":"EllipsoidTangentPlane-f1a69a20.js","sources":["../../../../Source/Core/EllipsoidTangentPlane.js"],"sourcesContent":["import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport Ray from \"./Ray.js\";\nimport Transforms from \"./Transforms.js\";\n\nconst scratchCart4 = new Cartesian4();\n/**\n * A plane tangent to the provided ellipsoid at the provided origin.\n * If origin is not on the surface of the ellipsoid, it's surface projection will be used.\n * If origin is at the center of the ellipsoid, an exception will be thrown.\n * @alias EllipsoidTangentPlane\n * @constructor\n *\n * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n *\n * @exception {DeveloperError} origin must not be at the center of the ellipsoid.\n */\nfunction EllipsoidTangentPlane(origin, ellipsoid) {\n //>>includeStart('debug', pragmas.debug);\n Check.defined(\"origin\", origin);\n //>>includeEnd('debug');\n\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n origin = ellipsoid.scaleToGeodeticSurface(origin);\n\n //>>includeStart('debug', pragmas.debug);\n if (!defined(origin)) {\n throw new DeveloperError(\n \"origin must not be at the center of the ellipsoid.\"\n );\n }\n //>>includeEnd('debug');\n\n const eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);\n this._ellipsoid = ellipsoid;\n this._origin = origin;\n this._xAxis = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 0, scratchCart4)\n );\n this._yAxis = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 1, scratchCart4)\n );\n\n const normal = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 2, scratchCart4)\n );\n this._plane = Plane.fromPointNormal(origin, normal);\n}\n\nObject.defineProperties(EllipsoidTangentPlane.prototype, {\n /**\n * Gets the ellipsoid.\n * @memberof EllipsoidTangentPlane.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the origin.\n * @memberof EllipsoidTangentPlane.prototype\n * @type {Cartesian3}\n */\n origin: {\n get: function () {\n return this._origin;\n },\n },\n\n /**\n * Gets the plane which is tangent to the ellipsoid.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Plane}\n */\n plane: {\n get: function () {\n return this._plane;\n },\n },\n\n /**\n * Gets the local X-axis (east) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n xAxis: {\n get: function () {\n return this._xAxis;\n },\n },\n\n /**\n * Gets the local Y-axis (north) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n yAxis: {\n get: function () {\n return this._yAxis;\n },\n },\n\n /**\n * Gets the local Z-axis (up) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n zAxis: {\n get: function () {\n return this._plane.normal;\n },\n },\n});\n\nconst tmp = new AxisAlignedBoundingBox();\n/**\n * Creates a new instance from the provided ellipsoid and the center\n * point of the provided Cartesians.\n *\n * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ell