소스 검색

Add normalized arg to constructor

WestLangley 7 년 전
부모
커밋
524571cfa1
2개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      docs/api/en/core/InstancedBufferAttribute.html
  2. 12 2
      src/core/InstancedBufferAttribute.js

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

@@ -17,7 +17,7 @@
 		</p>
 
 		<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>
 

+ 12 - 2
src/core/InstancedBufferAttribute.js

@@ -4,9 +4,19 @@ import { BufferAttribute } from './BufferAttribute.js';
  * @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;