InstancedBufferAttribute.js 750 B

12345678910111213141516171819202122232425262728293031
  1. import { BufferAttribute } from './BufferAttribute';
  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.create( BufferAttribute.prototype );
  10. InstancedBufferAttribute.prototype.constructor = InstancedBufferAttribute;
  11. InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;
  12. InstancedBufferAttribute.prototype.copy = function ( source ) {
  13. BufferAttribute.prototype.copy.call( this, source );
  14. this.meshPerAttribute = source.meshPerAttribute;
  15. return this;
  16. };
  17. export { InstancedBufferAttribute };
粤ICP备19079148号