Skip to content

Instantly share code, notes, and snippets.

@pavelvasev
Created January 7, 2015 11:15
Show Gist options
  • Save pavelvasev/46a9ac6d052eb5141c64 to your computer and use it in GitHub Desktop.
Save pavelvasev/46a9ac6d052eb5141c64 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment