WebGLProperties.js 476 B

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