Browse Source

Euler.toVector3(), very useful.

Ben Houston 10 years ago
parent
commit
ef3bfa70ad
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/math/Euler.js

+ 11 - 0
src/math/Euler.js

@@ -279,6 +279,17 @@ THREE.Euler.prototype = {
 		return [ this._x, this._y, this._z, this._order ];
 
 	},
+	
+	toVector3: function ( optionalResult ) {
+
+		if( optionalResult ) {
+			return optionalResult.set( this._x, this._y, this._z );
+		}
+		else {
+			return new THREE.Vector3( this._x, this._y, this._z );
+		}
+
+	},
 
 	onChange: function ( callback ) {