Skip to content

Conversation

@jfranc
Copy link
Contributor

@jfranc jfranc commented Apr 29, 2016

No description provided.

@mrdoob
Copy link
Owner

mrdoob commented Apr 29, 2016

Hmm, if I would have knew, I would have put the normalized parameter the third. Now we can't do that without breaking things :/

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 21, 2018

How about this:

function InstancedBufferAttribute( array, itemSize, normalized, meshPerAttribute ) {

	if ( typeof ( normalized ) === 'boolean' ) {

		BufferAttribute.call( this, array, itemSize, normalized );

	} else {

		BufferAttribute.call( this, array, itemSize );

		if ( typeof ( normalized ) === 'number' ) {

			meshPerAttribute = normalized;

			console.error( 'THREE.InstancedBufferAttribute: The constructor now expects a boolean as third parameter (normalized).' );

		}

	}

	this.meshPerAttribute = meshPerAttribute || 1;

}

This approach should be backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants