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

69 lines
1.7 KiB
JavaScript

/**
* R3.D3.API.Geometry.Normal.Plane
* @param apiGeometry
* @param width
* @param height
* @param widthSegments
* @param heightSegments
* @constructor
*/
R3.D3.API.Geometry.Normal.Plane = function(
apiGeometry,
width,
height,
widthSegments,
heightSegments
) {
if (R3.Utils.UndefinedOrNull(apiGeometry)) {
apiGeometry = {
geometryType: R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_PLANE
};
}
if (R3.Utils.UndefinedOrNull(apiGeometry.geometryType)) {
apiGeometry.geometryType = R3.D3.API.Geometry.GEOMETRY_TYPE_NORMAL_PLANE;
}
if (R3.Utils.UndefinedOrNull(width)) {
width = 1;
}
this.width = width;
if (R3.Utils.UndefinedOrNull(height)) {
height = 1;
}
this.height = height;
if (R3.Utils.UndefinedOrNull(widthSegments)) {
widthSegments = 1;
}
this.widthSegments = widthSegments;
if (R3.Utils.UndefinedOrNull(heightSegments)) {
heightSegments = 1;
}
this.heightSegments = heightSegments;
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.Plane.prototype = Object.create(R3.D3.API.Geometry.Normal.prototype);
R3.D3.API.Geometry.Normal.Plane.prototype.constructor = R3.D3.API.Geometry.Normal.Plane;