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

68 lines
1.6 KiB
JavaScript
Raw Normal View History

2018-02-09 16:08:43 +01:00
/**
2018-02-11 16:57:28 +01:00
* GameLib.D3.API.Geometry.Buffer.Tube
2018-02-09 16:08:43 +01:00
* @param apiGeometry
* @param path
* @param tubularSegments
* @param radius
* @param radialSegments
* @param closed
* @constructor
*/
2018-02-11 16:57:28 +01:00
GameLib.D3.API.Geometry.Buffer.Tube = function(
2018-02-09 16:08:43 +01:00
apiGeometry,
path,
tubularSegments,
radius,
radialSegments,
closed
) {
if (GameLib.Utils.UndefinedOrNull(apiGeometry)) {
apiGeometry = {
2018-02-11 16:57:28 +01:00
geometryType: GameLib.D3.API.Geometry.GEOMETRY_TYPE_BUFFER_TUBE
2018-02-09 16:08:43 +01:00
};
}
if (GameLib.Utils.UndefinedOrNull(apiGeometry.geometryType)) {
2018-02-11 16:57:28 +01:00
apiGeometry.geometryType = GameLib.D3.API.Geometry.GEOMETRY_TYPE_BUFFER_TUBE;
2018-02-09 16:08:43 +01:00
}
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;
2018-02-11 16:57:28 +01:00
GameLib.D3.API.Geometry.Buffer.call(
2018-02-09 16:08:43 +01:00
this,
2018-02-11 16:57:28 +01:00
apiGeometry,
apiGeometry.attributes,
apiGeometry.drawRange,
apiGeometry.groups,
apiGeometry.index,
apiGeometry.morphAttributes
2018-02-09 16:08:43 +01:00
);
};
2018-02-11 16:57:28 +01:00
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;