summaryrefslogtreecommitdiff
path: root/editor/plugins/node_3d_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-03 20:44:37 +0100
committerGitHub <noreply@github.com>2022-01-03 20:44:37 +0100
commit5cb6f39014a2c82f1aa3ed16509c91f444069521 (patch)
treeb19df298e93ea8b49c7c6d9eb18980b932ae47aa /editor/plugins/node_3d_editor_plugin.cpp
parent98b3ba1842a47a34097499a9eee6aa31083a99df (diff)
parentfb4261b82f518c76e197aba76f06f2d83d314a69 (diff)
Merge pull request #56444 from Calinou/3d-editor-freelook-sensitivity-scale-with-zoom
Diffstat (limited to 'editor/plugins/node_3d_editor_plugin.cpp')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index f49b749046..c2f8d144ee 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2439,7 +2439,8 @@ void Node3DEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const
_menu_option(VIEW_PERSPECTIVE);
}
- const real_t degrees_per_pixel = EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_sensitivity");
+ // Scale mouse sensitivity with camera FOV scale when zoomed in to make it easier to point at things.
+ const real_t degrees_per_pixel = real_t(EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_sensitivity")) * MIN(1.0, cursor.fov_scale);
const real_t radians_per_pixel = Math::deg2rad(degrees_per_pixel);
const bool invert_y_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_y_axis");