Skip to content

Instantly share code, notes, and snippets.

@flimshaw
Created September 20, 2016 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flimshaw/9c0037ce0e8874466c456cf438c5fb38 to your computer and use it in GitHub Desktop.
Save flimshaw/9c0037ce0e8874466c456cf438c5fb38 to your computer and use it in GitHub Desktop.
updateGeometry(buf, offset, count) {
if(this.offsetsProcessed.indexOf(offset) === -1) {
if(buf.length !== count) {
console.log("Invalid packet, rejecting");
}
this.offsetsProcessed.push(offset);
var _buf = buf;
var _offset = offset / 4;
var _count = count / 4;
let ar = new Float32Array(buf.buffer);
this.posAttribute.array.set(ar, _offset);
this.starCount += count/12;
this.bufferOffset += (buf.length);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment