InstancedBufferAttribute.js 675 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { BufferAttribute } from './BufferAttribute.js';
  2. /**
  3. * @author benaadams / https://twitter.com/ben_a_adams
  4. */
  5. function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) {
  6. BufferAttribute.call( this, array, itemSize );
  7. this.meshPerAttribute = meshPerAttribute || 1;
  8. }
  9. InstancedBufferAttribute.prototype = Object.assign( Object.create( BufferAttribute.prototype ), {
  10. constructor: InstancedBufferAttribute,
  11. isInstancedBufferAttribute: true,
  12. copy: function ( source ) {
  13. BufferAttribute.prototype.copy.call( this, source );
  14. this.meshPerAttribute = source.meshPerAttribute;
  15. return this;
  16. }
  17. } );
  18. export { InstancedBufferAttribute };
粤ICP备19079148号