File size: 640 Bytes
2b7aae2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { BufferGeometry } from './BufferGeometry.js';

class InstancedBufferGeometry extends BufferGeometry {
	constructor() {
		super();

		this.type = 'InstancedBufferGeometry';
		this.instanceCount = Infinity;
	}

	copy(source) {
		super.copy(source);

		this.instanceCount = source.instanceCount;

		return this;
	}

	clone() {
		return new this.constructor().copy(this);
	}

	toJSON() {
		const data = super.toJSON(this);

		data.instanceCount = this.instanceCount;

		data.isInstancedBufferGeometry = true;

		return data;
	}
}

InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;

export { InstancedBufferGeometry };