r3-legacy/src/game-lib-d3-api-geometry-bu...

68 lines
1.6 KiB
JavaScript

/**
* GameLib.D3.API.Geometry.Buffer.Tube
* @param apiGeometry
* @param path
* @param tubularSegments
* @param radius
* @param radialSegments
* @param closed
* @constructor
*/
GameLib.D3.API.Geometry.Buffer.Tube = function(
apiGeometry,
path,
tubularSegments,
radius,
radialSegments,
closed
) {
if (GameLib.Utils.UndefinedOrNull(apiGeometry)) {
apiGeometry = {
geometryType: GameLib.D3.API.Geometry.GEOMETRY_TYPE_BUFFER_TUBE
};
}
if (GameLib.Utils.UndefinedOrNull(apiGeometry.geometryType)) {
apiGeometry.geometryType = GameLib.D3.API.Geometry.GEOMETRY_TYPE_BUFFER_TUBE;
}
if (GameLib.Utils.UndefinedOrNull(path)) {
path = null;
}
this.path = path;
if (GameLib.Utils.UndefinedOrNull(tubularSegments)) {
tubularSegments = 64;
}
this.tubularSegments = tubularSegments;
if (GameLib.Utils.UndefinedOrNull(radius)) {
radius = 1;
}
this.radius = radius;
if (GameLib.Utils.UndefinedOrNull(radialSegments)) {
radialSegments = 8;
}
this.radialSegments = radialSegments;
if (GameLib.Utils.UndefinedOrNull(closed)) {
closed = false;
}
this.closed = closed;
GameLib.D3.API.Geometry.Buffer.call(
this,
apiGeometry,
apiGeometry.attributes,
apiGeometry.drawRange,
apiGeometry.groups,
apiGeometry.index,
apiGeometry.morphAttributes
);
};
GameLib.D3.API.Geometry.Buffer.Tube.prototype = Object.create(GameLib.D3.API.Geometry.Buffer.prototype);
GameLib.D3.API.Geometry.Buffer.Tube.prototype.constructor = GameLib.D3.API.Geometry.Buffer.Tube;