Parcourir la source

Fix rotationQuaternion being removed when using gizmo (#8660)

Popov72 il y a 5 ans
Parent
commit
9120645dad
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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;