Browse Source

Add normalized arg to constructor

WestLangley 7 years ago
parent
commit
524571cfa1

+ 1 - 1
docs/api/en/core/InstancedBufferAttribute.html

@@ -17,7 +17,7 @@
 		</p>
 		</p>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
-		<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
+		<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Boolean normalized], [param:Number meshPerAttribute] )</h3>
 		<p>
 		<p>
 		</p>
 		</p>
 
 

+ 12 - 2
src/core/InstancedBufferAttribute.js

@@ -4,9 +4,19 @@ import { BufferAttribute } from './BufferAttribute.js';
  * @author benaadams / https://twitter.com/ben_a_adams
  * @author benaadams / https://twitter.com/ben_a_adams
  */
  */
 
 
-function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) {
+function InstancedBufferAttribute( array, itemSize, normalized, meshPerAttribute ) {
 
 
-	BufferAttribute.call( this, array, itemSize );
+	if ( typeof ( normalized ) === 'number' ) {
+
+		meshPerAttribute = normalized;
+
+		normalized = false;
+
+		console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
+
+	}
+
+	BufferAttribute.call( this, array, itemSize, normalized );
 
 
 	this.meshPerAttribute = meshPerAttribute || 1;
 	this.meshPerAttribute = meshPerAttribute || 1;