瀏覽代碼

Fix issues with scaling 3D Objects

When scaling 3D objects the distance form them is not considered. Allowing for finer contorl. Overscaled objects no longer break the gizmo.
Krystof Klestil 4 年之前
父節點
當前提交
5e2450cae6
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      editor/plugins/spatial_editor_plugin.cpp

+ 2 - 0
editor/plugins/spatial_editor_plugin.cpp

@@ -1612,6 +1612,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
 							motion = Vector3(scale, scale, scale);
 							motion = Vector3(scale, scale, scale);
 						}
 						}
 
 
+						motion /= click.distance_to(_edit.center);
+
 						List<Node *> &selection = editor_selection->get_selected_node_list();
 						List<Node *> &selection = editor_selection->get_selected_node_list();
 
 
 						// Disable local transformation for TRANSFORM_VIEW
 						// Disable local transformation for TRANSFORM_VIEW