WebGLProperties.js 443 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @author fordacious / fordacious.github.io
  3. */
  4. THREE.WebGLProperties = function () {
  5. var properties = {};
  6. this.get = function ( object ) {
  7. var uuid = object.uuid;
  8. var map = properties[ uuid ];
  9. if ( map === undefined ) {
  10. map = {};
  11. properties[ uuid ] = map;
  12. }
  13. return map;
  14. };
  15. this.delete = function ( object ) {
  16. delete properties[ object.uuid ];
  17. };
  18. this.clear = function () {
  19. properties = {};
  20. };
  21. };