浏览代码

fix Vector3.toQuaternion()

Julien Barrois 6 年之前
父节点
当前提交
21f29f908c
共有 1 个文件被更改,包括 4 次插入4 次删除
  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();
             var len = this.length();
 
 
             if (len === 0) {
             if (len === 0) {
-                return this;
+                return this;
             }
             }
 
 
             var num = 1.0 / len;
             var num = 1.0 / len;
@@ -1616,7 +1616,7 @@ module BABYLON {
          * @returns a new Quaternion object, computed from the Vector3 coordinates
          * @returns a new Quaternion object, computed from the Vector3 coordinates
          */
          */
         public toQuaternion(): Quaternion {
         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 {
         public normalize(): Vector3 {
             var len = this.length();
             var len = this.length();
             if (len === 0 || len === 1.0) {
             if (len === 0 || len === 1.0) {
-                return this;
+                return this;
             }
             }
 
 
             var num = 1.0 / len;
             var num = 1.0 / len;
@@ -3100,7 +3100,7 @@ module BABYLON {
             var len = this.length();
             var len = this.length();
 
 
             if (len === 0) {
             if (len === 0) {
-                return this;
+                return this;
             }
             }
 
 
             var num = 1.0 / len;
             var num = 1.0 / len;