瀏覽代碼

Fix gizmos

David `Deltakosh` Catuhe 5 年之前
父節點
當前提交
187e75b83e
共有 2 個文件被更改,包括 3 次插入5 次删除
  1. 3 0
      src/Gizmos/axisDragGizmo.ts
  2. 0 5
      src/Gizmos/lightGizmo.ts

+ 3 - 0
src/Gizmos/axisDragGizmo.ts

@@ -115,6 +115,9 @@ export class AxisDragGizmo extends Gizmo {
                 }
                 // Snapping logic
                 if (this.snapDistance == 0) {
+                    if ((this.attachedNode as any).position) { // Required for nodes like lights
+                        (this.attachedNode as any).position.addInPlaceFromFloats(localDelta.x, localDelta.y, localDelta.z);
+                    }
                     this.attachedNode.getWorldMatrix().addTranslationFromFloats(localDelta.x, localDelta.y, localDelta.z);
                     this.attachedNode.updateCache();
                 } else {

+ 0 - 5
src/Gizmos/lightGizmo.ts

@@ -149,11 +149,6 @@ export class LightGizmo extends Gizmo {
                 this._cachedForward.copyFrom(this.attachedMesh!.forward);
             }
         }
-        if (!this._light.isEnabled()) {
-            this._material.diffuseColor.set(0, 0, 0);
-        } else {
-            this._material.diffuseColor.set(this._light.diffuse.r / 3, this._light.diffuse.g / 3, this._light.diffuse.b / 3);
-        }
     }
 
     // Static helper methods