r3-legacy/src/game-lib-d3-api-buffer-geom...

54 lines
1.6 KiB
JavaScript

/**
* GameLib.D3.API.BufferGeometry.Shape
* @param apiBufferGeometry
* @param shapes
* @param curveSegments
* @constructor
*/
GameLib.D3.API.BufferGeometry.Shape = function(
apiBufferGeometry,
shapes,
curveSegments
) {
if (GameLib.Utils.UndefinedOrNull(apiBufferGeometry)) {
apiBufferGeometry = {
bufferGeometryType: GameLib.D3.API.BufferGeometry.BUFFER_GEOMETRY_TYPE_SHAPE
};
}
if (GameLib.Utils.UndefinedOrNull(apiBufferGeometry.bufferGeometryType)) {
apiBufferGeometry.bufferGeometryType = GameLib.D3.API.BufferGeometry.BUFFER_GEOMETRY_TYPE_SHAPE;
}
if (GameLib.Utils.UndefinedOrNull(shapes)) {
shapes = [];
}
this.shapes = shapes;
if (GameLib.Utils.UndefinedOrNull(curveSegments)) {
curveSegments = 12;
}
this.curveSegments = curveSegments;
GameLib.D3.API.BufferGeometry.call(
this,
apiBufferGeometry.id,
apiBufferGeometry.name,
apiBufferGeometry.bufferGeometryType,
apiBufferGeometry.parentEntity,
apiBufferGeometry.faces,
apiBufferGeometry.vertices,
apiBufferGeometry.attributes,
apiBufferGeometry.boundingBox,
apiBufferGeometry.boundingSphere,
apiBufferGeometry.drawRange,
apiBufferGeometry.groups,
apiBufferGeometry.index,
apiBufferGeometry.morphAttributes
);
};
GameLib.D3.API.BufferGeometry.Shape.prototype = Object.create(GameLib.D3.API.BufferGeometry.prototype);
GameLib.D3.API.BufferGeometry.Shape.prototype.constructor = GameLib.D3.API.BufferGeometry.Shape;