r3-legacy/src/r3-d3-api-geometry-buffer-b...

54 lines
1.4 KiB
JavaScript

/**
* R3.D3.API.Geometry.Buffer.Box
* @param apiComponent
*
* @property width
* @property height
* @property depth
* @property widthSegments
* @property heightSegments
* @property depthSegments
*
* @constructor
*/
R3.D3.API.Geometry.Buffer.Box = function(
apiComponent
) {
__API_GEOMETRY_BUFFER__;
if (R3.Utils.UndefinedOrNull(apiComponent.width)) {
apiComponent.width = 1;
}
this.width = apiComponent.width;
if (R3.Utils.UndefinedOrNull(apiComponent.height)) {
apiComponent.height = 1;
}
this.height = apiComponent.height;
if (R3.Utils.UndefinedOrNull(apiComponent.depth)) {
apiComponent.depth = 1;
}
this.depth = apiComponent.depth;
if (R3.Utils.UndefinedOrNull(apiComponent.widthSegments)) {
apiComponent.widthSegments = 1;
}
this.widthSegments = apiComponent.widthSegments;
if (R3.Utils.UndefinedOrNull(apiComponent.heightSegments)) {
apiComponent.heightSegments = 1;
}
this.heightSegments = apiComponent.heightSegments;
if (R3.Utils.UndefinedOrNull(apiComponent.depthSegments)) {
apiComponent.depthSegments = 1;
}
this.depthSegments = apiComponent.depthSegments;
};
R3.D3.API.Geometry.Buffer.Box.prototype = Object.create(R3.D3.API.Geometry.Buffer.prototype);
R3.D3.API.Geometry.Buffer.Box.prototype.constructor = R3.D3.API.Geometry.Buffer.Box;