Forráskód Böngészése

disable gizmo rotation when in billboard mode

Cedric Guillemet 4 éve
szülő
commit
d0dca5d887
1 módosított fájl, 6 hozzáadás és 4 törlés
  1. 6 4
      src/Gizmos/gizmo.ts

+ 6 - 4
src/Gizmos/gizmo.ts

@@ -252,10 +252,12 @@ export class Gizmo implements IDisposable {
             } else {
                 this._attachedNode._worldMatrix.decompose(transform.scaling, this._tempQuaternion, transform.position);
             }
-            if (transform.rotationQuaternion) {
-                transform.rotationQuaternion.copyFrom(this._tempQuaternion);
-            } else {
-                transform.rotation = this._tempQuaternion.toEulerAngles();
+            if (!transform.billboardMode) {
+                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;