qd-changjing/public/static/Build/CesiumUnminified/Workers/CylinderGeometry-2bf20aa7.j...

1 line
29 KiB
Plaintext
Raw Normal View History

2022-07-05 16:56:29 +08:00
{"version":3,"file":"CylinderGeometry-2bf20aa7.js","sources":["../../../../Source/Core/CylinderGeometry.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 CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.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 radiusScratch = new Cartesian2();\nconst normalScratch = new Cartesian3();\nconst bitangentScratch = new Cartesian3();\nconst tangentScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\n\n/**\n * A description of a cylinder.\n *\n * @alias CylinderGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.length The length of the cylinder.\n * @param {Number} options.topRadius The radius of the top of the cylinder.\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderGeometry({\n * length: 200000,\n * topRadius: 80000,\n * bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);\n */\nfunction CylinderGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const length = options.length;\n const topRadius = options.topRadius;\n const bottomRadius = options.bottomRadius;\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n const slices = defaultValue(options.slices, 128);\n\n //>>includeStart('debug', pragmas.debug);\n if (!defined(length)) {\n throw new DeveloperError(\"options.length must be defined.\");\n }\n if (!defined(topRadius)) {\n throw new DeveloperError(\"options.topRadius must be defined.\");\n }\n if (!defined(bottomRadius)) {\n throw new DeveloperError(\"options.bottomRadius must be defined.\");\n }\n if (slices < 3) {\n throw new DeveloperError(\n \"options.slices must be greater than or equal to 3.\"\n );\n }\n if (\n defined(options.offsetAttribute) &&\n options.offsetAttribute === GeometryOffsetAttribute.TOP\n ) {\n throw new DeveloperError(\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n );\n }\n //>>includeEnd('debug');\n\n this._length = length;\n this._topRadius = topRadius;\n this._bottomRadius = bottomRadius;\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._slices = slices;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createCylinderGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCylinderGeometry.packedLength = VertexFormat.packedLength + 5;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number