Parcourir la source

fix Vector3.toQuaternion()

Julien Barrois il y a 6 ans
Parent
commit
21f29f908c
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      src/Math/babylon.math.ts

+ 4 - 4
src/Math/babylon.math.ts

@@ -1251,7 +1251,7 @@ module BABYLON {
             var len = this.length();
 
             if (len === 0) {
-                return this;
+                return this;
             }
 
             var num = 1.0 / len;
@@ -1616,7 +1616,7 @@ module BABYLON {
          * @returns a new Quaternion object, computed from the Vector3 coordinates
          */
         public toQuaternion(): Quaternion {
-            return BABYLON.Quaternion.RotationYawPitchRoll(this.x, this.y, this.z);
+            return BABYLON.Quaternion.RotationYawPitchRoll(this.y, this.x, this.z);
         }
 
         /**
@@ -1983,7 +1983,7 @@ module BABYLON {
         public normalize(): Vector3 {
             var len = this.length();
             if (len === 0 || len === 1.0) {
-                return this;
+                return this;
             }
 
             var num = 1.0 / len;
@@ -3100,7 +3100,7 @@ module BABYLON {
             var len = this.length();
 
             if (len === 0) {
-                return this;
+                return this;
             }
 
             var num = 1.0 / len;