InstancedBufferAttribute.js 699 B

123456789101112131415161718192021
  1. /**
  2. * @author benaadams / https://twitter.com/ben_a_adams
  3. */
  4. THREE.InstancedBufferAttribute = function (array, itemSize, meshPerAttribute, dynamic) {
  5. THREE.DynamicBufferAttribute.call( this, array, itemSize );
  6. this.dynamic = dynamic || false;
  7. this.meshPerAttribute = meshPerAttribute || 1;
  8. };
  9. THREE.InstancedBufferAttribute.prototype = Object.create( THREE.DynamicBufferAttribute.prototype );
  10. THREE.InstancedBufferAttribute.prototype.constructor = THREE.InstancedBufferAttribute;
  11. THREE.InstancedBufferAttribute.prototype.clone = function () {
  12. return new THREE.InstancedBufferAttribute( new this.array.constructor( this.array ), this.itemSize, this.meshPerAttribute, this.dynamic );
  13. };