Skip to content

Instantly share code, notes, and snippets.

@pavelvasev
Created January 7, 2015 11:16
Show Gist options
  • Save pavelvasev/02f85558b19a00239086 to your computer and use it in GitHub Desktop.
Save pavelvasev/02f85558b19a00239086 to your computer and use it in GitHub Desktop.
scenejs setIndices setPrimitive
SceneJS.Geometry.prototype.setIndices = function (data) {
if (data.indices && this._core.indexBuf) {
this._boundary = null;
var core = this._core;
core.indexBuf.bind();
core.indexBuf.setData(new Uint16Array(data.indices), data.indicesOffset || 0 );
core.arrays.indices.set(data.indices, data.indicesOffset || 0 );
this._engine.display.imageDirty = true;
}
};
SceneJS.Geometry.prototype.setPrimitive = function (data) {
this._core.primitive = this._getPrimitiveType(data.primitive);
this._engine.display.imageDirty = true;
}
@xeolabs
Copy link

xeolabs commented Jan 7, 2015

Nice - I'll include that in the next SceneJS iteration - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment