Skip to content

Instantly share code, notes, and snippets.

@ezekielchentnik
Created July 22, 2019 05:09
Show Gist options
  • Save ezekielchentnik/554fca595eaeb6dc04592109417bd5f7 to your computer and use it in GitHub Desktop.
Save ezekielchentnik/554fca595eaeb6dc04592109417bd5f7 to your computer and use it in GitHub Desktop.
Three.js Object pool
// function removeObject (object, pool) {
// var tempObj;
// for (var i = 0; i < pool.length; i++) {
// if ( pool[i] === object ) {
// pool.activeLength --;
// canvas.scene.remove( pool[i] );
// tempObj = pool[i];
// pool[pool[i]] = pool[pool.length - 1];
// return;
// }
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment