From 79733aa63a60b2f14abb96d7f33069bfdcaa46e4 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 15 Mar 2021 15:25:19 +0100 Subject: [PATCH] Mesh data editor's vertex translation should work properly with any rotation of the editor's camera. --- game/addons/mesh_data_resource_editor/MIDGizmo.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/addons/mesh_data_resource_editor/MIDGizmo.gd b/game/addons/mesh_data_resource_editor/MIDGizmo.gd index 5ecf1bcd..278ab0b9 100644 --- a/game/addons/mesh_data_resource_editor/MIDGizmo.gd +++ b/game/addons/mesh_data_resource_editor/MIDGizmo.gd @@ -40,13 +40,13 @@ func set_handle(index: int, camera: Camera, point: Vector2): var v : Vector3 = vertices[i] if (axis_constraint & AxisConstraint.X) != 0: - v.x += relative.x * -0.001 + v.x += relative.x * 0.001 * sign(camera.get_global_transform().basis.z.z) if (axis_constraint & AxisConstraint.Y) != 0: - v.y += relative.y * 0.001 + v.y += relative.y * -0.001 if (axis_constraint & AxisConstraint.Z) != 0: - v.z += relative.x * 0.001 + v.z += relative.x * 0.001 * -sign(camera.get_global_transform().basis.z.x) vertices.set(i, v)