Browse Source

Matrix4.multipleList - easy multiplication of an array of Matrix4. Useful for hierarchies.

Ben Houston 10 years ago
parent
commit
8d503f3b1b
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/math/Matrix4.js

+ 13 - 0
src/math/Matrix4.js

@@ -441,6 +441,19 @@ THREE.Matrix4.prototype = {
 
 	},
 
+
+	multiplyList: function ( listOfMatrices ) {
+
+		for (var i = 0, il = listOfMatrices.length; i < il ; i++) {
+
+		  this.multiplyMatrices( this, listOfMatrices[ i ] );
+
+		}
+
+		return this;
+
+	},
+
 	multiplyToArray: function ( a, b, r ) {
 
 		var te = this.elements;