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

90 lines
2.2 KiB
JavaScript

/**
* R3.D3.API.Geometry.Normal.Cone
* @param apiGeometry
* @param radius
* @param height
* @param radialSegments
* @param heightSegments
* @param openEnded
* @param thetaStart
* @param thetaLength
* @constructor
*/
R3.D3.API.Geometry.Normal.Cone = function(
apiGeometry,
radius,
height,
radialSegments,
heightSegments,
openEnded,
thetaStart,
thetaLength
) {
if (R3.Utils.UndefinedOrNull(apiGeometry)) {
apiGeometry = {
geometryType: R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_CONE
};
}
if (R3.Utils.UndefinedOrNull(apiGeometry.geometryType)) {
apiGeometry.geometryType = R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_CONE;
}
if (R3.Utils.UndefinedOrNull(radius)) {
radius = 1;
}
this.radius = radius;
if (R3.Utils.UndefinedOrNull(height)) {
height = 100;
}
this.height = height;
if (R3.Utils.UndefinedOrNull(radialSegments)) {
radialSegments = 8;
}
this.radialSegments = radialSegments;
if (R3.Utils.UndefinedOrNull(heightSegments)) {
heightSegments = 1;
}
this.heightSegments = heightSegments;
if (R3.Utils.UndefinedOrNull(openEnded)) {
openEnded = false;
}
this.openEnded = openEnded;
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.Cone.prototype = Object.create(R3.D3.API.Geometry.Normal.prototype);
R3.D3.API.Geometry.Normal.Cone.prototype.constructor = R3.D3.API.Geometry.Normal.Cone;