소스 검색

Merge pull request #581 from RaananW/quaternion-check

quaternion inspection
David Catuhe 10 년 전
부모
커밋
a838623dc2
2개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 3
      src/Mesh/babylon.mesh.js
  2. 4 1
      src/Mesh/babylon.mesh.ts

+ 5 - 3
src/Mesh/babylon.mesh.js

@@ -795,7 +795,10 @@ var BABYLON;
             this.scaling.copyFromFloats(1, 1, 1);
             this.position.copyFromFloats(0, 0, 0);
             this.rotation.copyFromFloats(0, 0, 0);
-            this.rotationQuaternion = BABYLON.Quaternion.Identity();
+            //only if quaternion is already set
+            if(this.rotationQuaternion) {
+                this.rotationQuaternion = BABYLON.Quaternion.Identity();
+            }
             this._worldMatrix = BABYLON.Matrix.Identity();
         };
         // Cache
@@ -1725,5 +1728,4 @@ var BABYLON;
         return Mesh;
     })(BABYLON.AbstractMesh);
     BABYLON.Mesh = Mesh;
-})(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.mesh.js.map
+})(BABYLON || (BABYLON = {}));

+ 4 - 1
src/Mesh/babylon.mesh.ts

@@ -921,7 +921,10 @@
             this.scaling.copyFromFloats(1, 1, 1);
             this.position.copyFromFloats(0, 0, 0);
             this.rotation.copyFromFloats(0, 0, 0);
-            this.rotationQuaternion = Quaternion.Identity();
+            //only if quaternion is already set
+            if(this.rotationQuaternion) {
+                this.rotationQuaternion = Quaternion.Identity();
+            }
             this._worldMatrix = Matrix.Identity();
         }