| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import { BufferAttribute } from './BufferAttribute.js';
- class InstancedBufferAttribute extends BufferAttribute {
- constructor( array, itemSize, normalized, meshPerAttribute = 1 ) {
- if ( typeof normalized === 'number' ) {
- meshPerAttribute = normalized;
- normalized = false;
- console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
- }
- super( array, itemSize, normalized );
- this.isInstancedBufferAttribute = true;
- this.meshPerAttribute = meshPerAttribute;
- }
- copy( source ) {
- super.copy( source );
- this.meshPerAttribute = source.meshPerAttribute;
- return this;
- }
- toJSON() {
- const data = super.toJSON();
- data.meshPerAttribute = this.meshPerAttribute;
- data.isInstancedBufferAttribute = true;
- return data;
- }
- }
- export { InstancedBufferAttribute };
|