Przeglądaj źródła

Fix rotationQuaternion being removed when using gizmo (#8660)

Popov72 5 lat temu
rodzic
commit
9120645dad
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/Gizmos/gizmo.ts

+ 2 - 1
src/Gizmos/gizmo.ts

@@ -205,9 +205,10 @@ export class Gizmo implements IDisposable {
             } else {
                 this._attachedNode._worldMatrix.decompose(transform.scaling, this._tempQuaternion, transform.position);
             }
-            transform.rotation = this._tempQuaternion.toEulerAngles();
             if (transform.rotationQuaternion) {
                 transform.rotationQuaternion.copyFrom(this._tempQuaternion);
+            } else {
+                transform.rotation = this._tempQuaternion.toEulerAngles();
             }
         } else if (this._attachedNode.getClassName() === "Bone") {
             var bone = this._attachedNode as Bone;