Skip to content

Commit

Permalink
All VBOs mutable in geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Oct 15, 2011
1 parent 042819a commit 1de68c8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/scenejs/geometry/geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,39 +308,40 @@ new (function() {
};

SceneJS_geometry.prototype.setNormals = function(params) {
return this._getArrays().normals.set(params.normals, params.offset);
this.core.normalBuf.bind();
this.core.normalBuf.setData(params.normals, params.offset || 0);
};

SceneJS_geometry.prototype.getColors = function() {
return this._getArrays().colors;
};

SceneJS_geometry.prototype.setColors = function(params) {
return this._getArrays().colors.set(params.colors, params.offset);
this.core.colorBuf.bind();
this.core.colorBuf.setData(params.colors, params.offset || 0);
};

SceneJS_geometry.prototype.getIndices = function() {
return this._getArrays().indices;
};

SceneJS_geometry.prototype.setIndices = function(params) {
return this._getArrays().colors.set(params.indices, params.offset);
};

SceneJS_geometry.prototype.getUv = function() {
return this._getArrays().uv;
};

SceneJS_geometry.prototype.setUv = function(params) {
return this._getArrays().uv.set(params.uv, params.offset);
this.core.uvBuf.bind();
this.core.uvBuf.setData(params.uv, params.offset || 0);
};

SceneJS_geometry.prototype.getUv2 = function() {
return this._getArrays().uv2;
};

SceneJS_geometry.prototype.setUv2 = function(params) {
return this._getArrays().uv2.set(params.uv2, params.offset);
this.core.uvBuf2.bind();
this.core.uvBuf2.setData(params.uv2, params.offset || 0);
};

SceneJS_geometry.prototype.getPrimitive = function() {
Expand Down Expand Up @@ -402,11 +403,11 @@ new (function() {
};

SceneJS_geometry.prototype._compile = function() {
if (!this.core._loading) {
if (!this.core._loading) {
pushGeometry(this.attr.id, this.core);
}
this._compileNodes();
if (!this.core._loading) {
if (!this.core._loading) {
popGeometry();
}
};
Expand Down

0 comments on commit 1de68c8

Please sign in to comment.