1 line
43 KiB
Plaintext
1 line
43 KiB
Plaintext
|
{"version":3,"file":"EllipsoidGeometry-c1dcbb8c.js","sources":["../../../../Source/Core/EllipsoidGeometry.js"],"sourcesContent":["import arrayFill from \"./arrayFill.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst scratchNormalST = new Cartesian3();\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\n\nconst cos = Math.cos;\nconst sin = Math.sin;\n\n/**\n * A description of an ellipsoid centered at the origin.\n *\n * @alias EllipsoidGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\n * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\n * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\n *\n * @see EllipsoidGeometry#createGeometry\n *\n * @example\n * const ellipsoid = new Cesium.EllipsoidGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);\n */\nfunction EllipsoidGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const radii = defaultValue(options.radii, defaultRadii);\n const innerRadii = defaultValue(options.innerRadii, radii);\n const minimumClock = defaultValue(options.minimumClock, 0.0);\n const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\n const minimumCone = defaultValue(options.minimumCone, 0.0);\n const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\n const stackPartitions = Math.round(defaultValue(options.stackPartitions, 64));\n const slicePartitions = Math.round(defaultValue(options.slicePartitions, 64));\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n //>>includeStart('debug', pragmas.debug);\n if (slicePartitions < 3) {\n throw new DeveloperError(\n \"options.slicePartitions cannot be less than three.\"\n );\n }\n if (stackPartitions < 3) {\n
|