Explorar o código

Fix rotationQuaternion being removed when using gizmo (#8660)

Popov72 %!s(int64=5) %!d(string=hai) anos
pai
achega
9120645dad
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/Gizmos/gizmo.ts

+ 2 - 1
src/Gizmos/gizmo.ts

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