StorageBufferAttribute.js 419 B

123456789101112131415161718192021
  1. import { InstancedBufferAttribute } from 'three';
  2. class StorageBufferAttribute extends InstancedBufferAttribute {
  3. constructor( array, itemSize ) {
  4. super( array, itemSize );
  5. this.isStorageBufferAttribute = true;
  6. }
  7. static create( count, itemSize, typeClass = Float32Array ) {
  8. return new StorageBufferAttribute( new typeClass( count * itemSize ), itemSize );
  9. }
  10. }
  11. export default StorageBufferAttribute;