52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
/**
|
|
* R3.D3.Geometry.Buffer.Cylinder
|
|
* @param apiComponent
|
|
* @constructor
|
|
*/
|
|
R3.D3.Geometry.Buffer.Cylinder = function(
|
|
apiComponent
|
|
) {
|
|
|
|
__RUNTIME_COMPONENT__;
|
|
|
|
__RUNTIME_BUFFER_COMPONENT__;
|
|
|
|
};
|
|
|
|
R3.D3.Geometry.Buffer.Cylinder.prototype = Object.create(R3.D3.Geometry.Buffer.prototype);
|
|
R3.D3.Geometry.Buffer.Cylinder.prototype.constructor = R3.D3.Geometry.Buffer.Cylinder;
|
|
|
|
/**
|
|
* Creates a light instance
|
|
* @returns {*}
|
|
*/
|
|
R3.D3.Geometry.Buffer.Cylinder.prototype.createInstance = function() {
|
|
|
|
this.instance = this.graphics.GeometryBufferCylinder(this);
|
|
|
|
R3.D3.Geometry.Buffer.prototype.createInstance.call(this);
|
|
|
|
};
|
|
|
|
/**
|
|
* Updates the instance with the current state
|
|
*/
|
|
R3.D3.Geometry.Buffer.Cylinder.prototype.updateInstance = function(property) {
|
|
|
|
if (
|
|
property === 'radiusTop' ||
|
|
property === 'radiusBottom' ||
|
|
property === 'height' ||
|
|
property === 'radialSegments' ||
|
|
property === 'heightSegments' ||
|
|
property === 'openEnded' ||
|
|
property === 'thetaStart' ||
|
|
property === 'thetaLength'
|
|
) {
|
|
this.instance = this.createInstance();
|
|
return;
|
|
}
|
|
|
|
R3.D3.Geometry.Buffer.prototype.updateInstance.call(this, property);
|
|
};
|