Răsfoiți Sursa

Merge remote-tracking branch 'WestLangley/dev-quaternion' into dev

Mr.doob 13 ani în urmă
părinte
comite
fa78ea27a9
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      src/core/Quaternion.js

+ 4 - 4
src/core/Quaternion.js

@@ -174,15 +174,15 @@ THREE.Quaternion.prototype = {
 
 	},
 
-	calculateW : function () {
+	inverse: function () {
 
-		this.w = - Math.sqrt( Math.abs( 1.0 - this.x * this.x - this.y * this.y - this.z * this.z ) );
+		this.conjugate().normalize();
 
 		return this;
 
 	},
 
-	inverse: function () {
+	conjugate: function () {
 
 		this.x *= -1;
 		this.y *= -1;
@@ -207,7 +207,7 @@ THREE.Quaternion.prototype = {
 			this.x = 0;
 			this.y = 0;
 			this.z = 0;
-			this.w = 0;
+			this.w = 1;
 
 		} else {