Bladeren bron

Matrix4: added premultiply() method

* Matrix4: added preMultiply method

* Matri4: preMultiply -> premultiply
WestLangley 9 jaren geleden
bovenliggende
commit
7514780978
2 gewijzigde bestanden met toevoegingen van 12 en 1 verwijderingen
  1. 6 1
      docs/api/math/Matrix4.html
  2. 6 0
      src/math/Matrix4.js

+ 6 - 1
docs/api/math/Matrix4.html

@@ -94,7 +94,12 @@
 
 		<h3>[method:Matrix4 multiply]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
 		<div>
-		Multiplies this matrix by *m*.
+		Post-multiplies this matrix by *m*.
+		</div>
+
+		<h3>[method:Matrix4 premultiply]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
+		<div>
+		Pre-multiplies this matrix by *m*.
 		</div>
 
 		<h3>[method:Matrix4 multiplyMatrices]( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4 this]</h3>

+ 6 - 0
src/math/Matrix4.js

@@ -365,6 +365,12 @@ THREE.Matrix4.prototype = {
 
 	},
 
+	premultiply: function ( m ) {
+
+		return this.multiplyMatrices( m, this );
+
+	},
+
 	multiplyMatrices: function ( a, b ) {
 
 		var ae = a.elements;