InstancedBufferGeometry.js 562 B

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