Browse Source

Quaternion: Avoiding double call to onChangeCallback in setFromUnitVectors. Added call to onChangeCallback in normalize(). See fffeeb636ee9fa38f2e3a51358c361116d827d8b.

Mr.doob 11 years ago
parent
commit
eabdc89686
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/math/Quaternion.js

+ 7 - 2
src/math/Quaternion.js

@@ -280,9 +280,12 @@ THREE.Quaternion.prototype = {
 
 			}
 
-			this.set( v1.x, v1.y, v1.z, r ).normalize();
+			this._x = v1.x;
+			this._y = v1.y;
+			this._z = v1.z;
+			this._w = r;
 
-			this.onChangeCallback();
+			this.normalize();
 
 			return this;
 
@@ -344,6 +347,8 @@ THREE.Quaternion.prototype = {
 
 		}
 
+		this.onChangeCallback();
+
 		return this;
 
 	},