Browse Source

implement initial Euler.reorder() function and remove Euler.alternativeSolution() per @WestLangley.

Ben Houston 12 years ago
parent
commit
09d6532e84
1 changed files with 10 additions and 8 deletions
  1. 10 8
      src/math/Euler.js

+ 10 - 8
src/math/Euler.js

@@ -251,19 +251,21 @@ THREE.Euler.prototype = {
 		
 	},
 
-	reorder: function( newOrder ) {
+	reorder: function() {
 
-		// todo.
-		console.error( "ERROR: Euler.reorder() is not yet implemented.");
+		// WARNING: this discards revolution information -bhouston
 
-	},
+		var q = new THREE.Quaternion();
 
-	alternativeSolution: function() {
+		return function( newOrder ) {
 
-		// todo.
-		console.error( "ERROR: Euler.alternativeSolution() is not yet implemented.");
+			q.setFromEuler( euler );
+			euler.setFromQuaternion( q, newOrder );
 
-	},
+		};
+
+
+	}(),
 
 	fromArray: function ( array ) {