Browse Source

Matrix4.setRotationFrom* -> Matrix4.makeRotationFrom* and make them fully destructive as they are already partially destructive.

Ben Houston 12 years ago
parent
commit
0bf97352fa
1 changed files with 24 additions and 2 deletions
  1. 24 2
      src/math/Matrix4.js

+ 24 - 2
src/math/Matrix4.js

@@ -119,7 +119,7 @@ THREE.Matrix4.prototype = {
 
 	}(),
 
-	setRotationFromEuler: function ( v, order ) {
+	makeRotationFromEuler: function ( v, order ) {
 
 		var te = this.elements;
 
@@ -226,11 +226,22 @@ THREE.Matrix4.prototype = {
 
 		}
 
+		// last column
+		te[3] = 0;
+		te[7] = 0;
+		te[11] = 0;
+
+		// bottom row
+		te[12] = 0;
+		te[13] = 0;
+		te[14] = 0;
+		te[15] = 1;
+
 		return this;
 
 	},
 
-	setRotationFromQuaternion: function ( q ) {
+	makeRotationFromQuaternion: function ( q ) {
 
 		var te = this.elements;
 
@@ -252,6 +263,17 @@ THREE.Matrix4.prototype = {
 		te[6] = yz + wx;
 		te[10] = 1 - ( xx + yy );
 
+		// last column
+		te[3] = 0;
+		te[7] = 0;
+		te[11] = 0;
+
+		// bottom row
+		te[12] = 0;
+		te[13] = 0;
+		te[14] = 0;
+		te[15] = 1;
+
 		return this;
 
 	},