GLBufferAttribute.js 853 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. function GLBufferAttribute( buffer, type, itemSize, elementSize, count ) {
  2. this.buffer = buffer;
  3. this.type = type;
  4. this.itemSize = itemSize;
  5. this.elementSize = elementSize;
  6. this.count = count;
  7. this.version = 0;
  8. }
  9. Object.defineProperty( GLBufferAttribute.prototype, 'needsUpdate', {
  10. set: function ( value ) {
  11. if ( value === true ) this.version ++;
  12. }
  13. } );
  14. Object.assign( GLBufferAttribute.prototype, {
  15. isGLBufferAttribute: true,
  16. setBuffer: function ( buffer ) {
  17. this.buffer = buffer;
  18. return this;
  19. },
  20. setType: function ( type, elementSize ) {
  21. this.type = type;
  22. this.elementSize = elementSize;
  23. return this;
  24. },
  25. setItemSize: function ( itemSize ) {
  26. this.itemSize = itemSize;
  27. return this;
  28. },
  29. setCount: function ( count ) {
  30. this.count = count;
  31. return this;
  32. },
  33. } );
  34. export { GLBufferAttribute };