InstancedBufferGeometry.js 658 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { BufferGeometry } from './BufferGeometry.js';
  2. class InstancedBufferGeometry extends BufferGeometry {
  3. constructor() {
  4. super();
  5. this.type = 'InstancedBufferGeometry';
  6. this.instanceCount = Infinity;
  7. }
  8. copy( source ) {
  9. super.copy( source );
  10. this.instanceCount = source.instanceCount;
  11. return this;
  12. }
  13. clone() {
  14. return new this.constructor().copy( this );
  15. }
  16. toJSON() {
  17. const data = super.toJSON( this );
  18. data.instanceCount = this.instanceCount;
  19. data.isInstancedBufferGeometry = true;
  20. return data;
  21. }
  22. }
  23. InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
  24. export { InstancedBufferGeometry };
粤ICP备19079148号