r3-legacy/src/r3-d3-geometry-buffer-cylin...

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-04-09 09:35:04 +02:00
/**
* R3.D3.Geometry.Buffer.Cylinder
2019-10-06 21:11:18 +02:00
* @param apiComponent
2018-04-09 09:35:04 +02:00
* @constructor
*/
R3.D3.Geometry.Buffer.Cylinder = function(
2019-10-06 21:11:18 +02:00
apiComponent
2018-04-09 09:35:04 +02:00
) {
2019-10-06 21:11:18 +02:00
__RUNTIME_COMPONENT__;
2018-04-09 09:35:04 +02:00
2019-10-06 21:11:18 +02:00
__RUNTIME_BUFFER_COMPONENT__;
2018-04-09 09:35:04 +02:00
};
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() {
2019-10-06 21:11:18 +02:00
this.instance = this.graphics.GeometryBufferCylinder(this);
2018-04-09 09:35:04 +02:00
R3.D3.Geometry.Buffer.prototype.createInstance.call(this);
2019-10-06 21:11:18 +02:00
2018-04-09 09:35:04 +02:00
};
/**
* 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'
) {
2019-10-06 21:11:18 +02:00
this.instance = this.createInstance();
2018-04-09 09:35:04 +02:00
return;
}
R3.D3.Geometry.Buffer.prototype.updateInstance.call(this, property);
};