app/assets/javascripts/Core/SphereGeometry.js in cesium-0.19.0 vs app/assets/javascripts/Core/SphereGeometry.js in cesium-0.20.0
- old
+ new
@@ -4,69 +4,53 @@
Cartesian3,
EllipsoidGeometry) {
"use strict";
/**
- * A {@link Geometry} that represents vertices and indices for an ellipse on the ellipsoid.
+ * A description of a sphere centered at the origin.
*
- * Creates vertices and indices for an sphere centered at the origin.
- *
* @alias SphereGeometry
* @constructor
*
* @param {Number} [options.radius=1.0] The radius of the sphere.
- * @param {Number} [options.numberOfPartitions=32] The number of times to partition the sphere in a plane formed by two radii in a single quadrant.
+ * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.
+ * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
*
- * @exception {DeveloperError} options.numberOfPartitions must be greater than zero.
+ * @exception {DeveloperError} options.slicePartitions cannot be less than three.
+ * @exception {DeveloperError} options.stackPartitions cannot be less than three.
*
+ * @see SphereGeometry#createGeometry
+ *
* @example
* var sphere = new SphereGeometry({
* radius : 100.0,
* vertexFormat : VertexFormat.POSITION_ONLY
* });
+ * var geometry = SphereGeometry.createGeometry(sphere);
*/
var SphereGeometry = function(options) {
var radius = defaultValue(options.radius, 1.0);
var radii = new Cartesian3(radius, radius, radius);
var ellipsoidOptions = {
radii: radii,
- numberOfPartitions: options.numberOfPartitions,
+ stackPartitions: options.stackPartitions,
+ slicePartitions: options.slicePartitions,
vertexFormat: options.vertexFormat
};
- var ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions);
+ this._ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions);
+ this._workerName = 'createSphereGeometry';
+ };
- /**
- * An object containing {@link GeometryAttribute} properties named after each of the
- * <code>true</code> values of the {@link VertexFormat} option.
- *
- * @type Object
- *
- * @see Geometry#attributes
- */
- this.attributes = ellipsoidGeometry.attributes;
-
- /**
- * Index data that - along with {@link Geometry#primitiveType} - determines the primitives in the geometry.
- *
- * @type Array
- */
- this.indices = ellipsoidGeometry.indices;
-
- /**
- * The type of primitives in the geometry. For this geometry, it is {@link PrimitiveType.TRIANGLES}.
- *
- * @type PrimitiveType
- */
- this.primitiveType = ellipsoidGeometry.primitiveType;
-
- /**
- * A tight-fitting bounding sphere that encloses the vertices of the geometry.
- *
- * @type BoundingSphere
- */
- this.boundingSphere = ellipsoidGeometry.boundingSphere;
+ /**
+ * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {SphereGeometry} sphereGeometry A description of the sphere.
+ * @returns {Geometry} The computed vertices and indices.
+ */
+ SphereGeometry.createGeometry = function(sphereGeometry) {
+ return EllipsoidGeometry.createGeometry(sphereGeometry._ellipsoidGeometry);
};
return SphereGeometry;
-});
\ No newline at end of file
+});