소스 검색

disable gizmo rotation when in billboard mode

Cedric Guillemet 4 년 전
부모
커밋
d0dca5d887
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  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;