r3-legacy/src/r3-d3-api-geometry-buffer-0.js

63 lines
1.6 KiB
JavaScript

/**
* R3.D3.API.Geometry.Buffer
* @param apiComponent
*
* @property attributes
* @property drawRange
* @property groups
* @property index
* @property morphAttributes
*
* @constructor
*/
R3.D3.API.Geometry.Buffer = function(
apiComponent
) {
R3.D3.API.Geometry.call(
this,
apiComponent
);
if (R3.Utils.UndefinedOrNull(apiComponent.attributes)) {
apiComponent.attributes = [];
}
this.attributes = apiComponent.attributes;
if (R3.Utils.UndefinedOrNull(apiComponent.groups)) {
apiComponent.groups = [];
}
this.groups = apiComponent.groups;
if (R3.Utils.UndefinedOrNull(apiComponent.drawRange)) {
apiComponent.drawRange = new R3.API.DrawRange(
{
parent : this
}
)
}
this.drawRange = apiComponent.drawRange;
if (R3.Utils.UndefinedOrNull(apiComponent.index)) {
apiComponent.index = null;
}
this.index = apiComponent.index;
if (R3.Utils.UndefinedOrNull(apiComponent.morphAttributes)) {
apiComponent.morphAttributes = null;
}
this.morphAttributes = apiComponent.morphAttributes;
};
R3.D3.API.Geometry.Buffer.prototype = Object.create(R3.D3.API.Geometry.prototype);
R3.D3.API.Geometry.Buffer.prototype.constructor = R3.D3.API.Geometry.Buffer;
R3.D3.API.Geometry.Buffer.prototype.updateNormals = function() {
console.warn('todo: R3.D3.API.Geometry.Buffer.prototype.updateNormals');
};
R3.D3.API.Geometry.Buffer.prototype.updatePositions = function() {
console.warn('todo: R3.D3.API.Geometry.Buffer.prototype.updatePositions');
};