2
0
Эх сурвалжийг харах

InstancedMesh: Changed setMatrixAt parameter order.

Mr.doob 5 жил өмнө
parent
commit
6d8059c95d

+ 1 - 1
examples/webgl_instancing.html

@@ -57,7 +57,7 @@
 
 					dummy.updateMatrix();
 
-					mesh.setMatrixAt( dummy.matrix, i );
+					mesh.setMatrixAt( i, dummy.matrix );
 
 				}
 

+ 3 - 3
src/objects/InstancedMesh.js

@@ -25,11 +25,11 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
 
 	raycast: function () {},
 
-	setMatrixAt: function ( matrix, offset ) {
+	setMatrixAt: function ( index, matrix ) {
 
-		matrix.toArray( this.instanceMatrix.array, offset * 16 );
+		matrix.toArray( this.instanceMatrix.array, index * 16 );
 
-		_matrix3.getNormalMatrix( matrix ).toArray( this.instanceNormalMatrix.array, offset * 9 );
+		_matrix3.getNormalMatrix( matrix ).toArray( this.instanceNormalMatrix.array, index * 9 );
 
 	},