Merge pull request #116991 from jazztickets/freelook_invert_y_axis

Add separate Freelook Invert Y Axis option
This commit is contained in:
Thaddeus Crews 2026-03-04 11:20:37 -06:00
commit d5e2ac7e02
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
3 changed files with 6 additions and 2 deletions

View file

@ -392,6 +392,9 @@
<member name="editors/3d/freelook/freelook_inertia" type="float" setter="" getter="">
The inertia of the 3D freelook camera. Higher values make the camera start and stop slower, which looks smoother but adds latency.
</member>
<member name="editors/3d/freelook/freelook_invert_y_axis" type="bool" setter="" getter="">
If [code]true[/code], invert the vertical mouse axis when using freelook mode in the 3D editor.
</member>
<member name="editors/3d/freelook/freelook_navigation_scheme" type="int" setter="" getter="">
The navigation scheme to use when freelook is enabled in the 3D editor. Some of the navigation schemes below may be more convenient when designing specific levels in the 3D editor.
- [b]Default:[/b] The "Freelook Forward", "Freelook Backward", "Freelook Up" and "Freelook Down" keys will move relative to the camera, taking its pitch angle into account for the movement.
@ -443,7 +446,7 @@
If [code]true[/code], invert the horizontal mouse axis when panning or orbiting in the 3D editor. This setting does [i]not[/i] apply to freelook mode.
</member>
<member name="editors/3d/navigation/invert_y_axis" type="bool" setter="" getter="">
If [code]true[/code], invert the vertical mouse axis when panning, orbiting, or using freelook mode in the 3D editor.
If [code]true[/code], invert the vertical mouse axis when panning or orbiting in the 3D editor.
</member>
<member name="editors/3d/navigation/navigation_scheme" type="int" setter="" getter="">
The navigation scheme preset to use in the 3D editor. Changing this setting will affect the mouse button and modifier keys used to navigate the 3D editor viewport.

View file

@ -2991,7 +2991,7 @@ void Node3DEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const
// 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(EDITOR_GET("editors/3d/freelook/freelook_sensitivity")) * MIN(1.0, cursor.fov_scale);
const real_t radians_per_pixel = Math::deg_to_rad(degrees_per_pixel);
const bool invert_y_axis = EDITOR_GET("editors/3d/navigation/invert_y_axis");
const bool invert_y_axis = EDITOR_GET("editors/3d/freelook/freelook_invert_y_axis");
// Note: do NOT assume the camera has the "current" transform, because it is interpolated and may have "lag".
const Transform3D prev_camera_transform = to_camera_transform(cursor);

View file

@ -981,6 +981,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_inertia", 0.0, "0,1,0.001")
EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_base_speed", 5.0, "0,10,0.01,or_greater")
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_activation_modifier", 0, "None,Shift,Alt,Meta,Ctrl")
_initial_set("editors/3d/freelook/freelook_invert_y_axis", false);
_initial_set("editors/3d/freelook/freelook_speed_zoom_link", false);
// 3D: Manipulator