r3-legacy/src/r3-d3-api-geometry-normal-c...

69 lines
1.7 KiB
JavaScript

/**
* R3.D3.API.Geometry.Normal.Circle
* @param apiGeometry
* @param radius
* @param segments
* @param thetaStart
* @param thetaLength
* @constructor
*/
R3.D3.API.Geometry.Normal.Circle = function(
apiGeometry,
radius,
segments,
thetaStart,
thetaLength
) {
if (R3.Utils.UndefinedOrNull(apiGeometry)) {
apiGeometry = {
geometryType: R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_CIRCLE
};
}
if (R3.Utils.UndefinedOrNull(apiGeometry.geometryType)) {
apiGeometry.geometryType = R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_CIRCLE;
}
if (R3.Utils.UndefinedOrNull(radius)) {
radius = 1;
}
this.radius = radius;
if (R3.Utils.UndefinedOrNull(segments)) {
segments = 8;
}
this.segments = segments;
if (R3.Utils.UndefinedOrNull(thetaStart)) {
thetaStart = 0;
}
this.thetaStart = thetaStart;
if (R3.Utils.UndefinedOrNull(thetaLength)) {
thetaLength = Math.PI * 2;
}
this.thetaLength = thetaLength;
R3.D3.API.Geometry.Normal.call(
this,
apiGeometry,
apiGeometry.colors,
apiGeometry.lineDistances,
apiGeometry.morphTargets,
apiGeometry.morphNormals,
apiGeometry.skinWeights,
apiGeometry.skinIndices,
apiGeometry.verticesNeedsUpdate,
apiGeometry.elementsNeedUpdate,
apiGeometry.uvsNeedUpdate,
apiGeometry.normalsNeedUpdate,
apiGeometry.colorsNeedUpdate,
apiGeometry.groupsNeedUpdate,
apiGeometry.lineDistancesNeedUpdate
);
};
R3.D3.API.Geometry.Normal.Circle.prototype = Object.create(R3.D3.API.Geometry.Normal.prototype);
R3.D3.API.Geometry.Normal.Circle.prototype.constructor = R3.D3.API.Geometry.Normal.Circle;