Browse Source

Alternate approach to: Working lookat() also when useQuaternion = true

Fredrik Wollsén 12 years ago
parent
commit
20e405a282
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/cameras/Camera.js
  2. 1 1
      src/core/Object3D.js

+ 1 - 1
src/cameras/Camera.js

@@ -30,7 +30,7 @@ THREE.Camera.prototype.lookAt = function ( vector ) {
 			
 		} else {
 			
-			this.quaternion.setFromRotationMatrix( this.matrix );
+			this.quaternion.copy(this.matrix.decompose()[1]);
 			
 		}
 

+ 1 - 1
src/core/Object3D.js

@@ -120,7 +120,7 @@ THREE.Object3D.prototype = {
 
 			} else {
 
-				this.quaternion.setFromRotationMatrix( this.matrix );
+				this.quaternion.copy(this.matrix.decompose()[1]);
 
 			}