Skip to content

Commit

Permalink
Merge pull request #81714 from CreepGin/navigation_feel
Browse files Browse the repository at this point in the history
Add 3D translation sensitivity to Editor Settings
  • Loading branch information
Repiteo committed Dec 9, 2024
2 parents e06f699 + 174e659 commit fb4d401
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@
<member name="editors/3d/navigation_feel/translation_inertia" type="float" setter="" getter="">
The inertia to use when panning in the 3D editor. Higher values make the camera start and stop slower, which looks smoother but adds latency.
</member>
<member name="editors/3d/navigation_feel/translation_sensitivity" type="float" setter="" getter="">
The mouse sensitivity to use when panning in the 3D editor.
</member>
<member name="editors/3d/navigation_feel/zoom_inertia" type="float" setter="" getter="">
The inertia to use when zooming in the 3D editor. Higher values make the camera start and stop slower, which looks smoother but adds latency.
</member>
Expand Down
3 changes: 2 additions & 1 deletion editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/3d/navigation/warped_mouse_panning", true, true);

// 3D: Navigation feel
EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,2,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,20,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_sensitivity", 1.0, "0.01,20,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_inertia", 0.0, "0,1,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_inertia", 0.05, "0,1,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/zoom_inertia", 0.05, "0,1,0.001")
Expand Down
3 changes: 2 additions & 1 deletion editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2501,8 +2501,9 @@ Node3DEditorViewport::NavigationMode Node3DEditorViewport::_get_nav_mode_from_sh

void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
const NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int();
const real_t translation_sensitivity = EDITOR_GET("editors/3d/navigation_feel/translation_sensitivity");

real_t pan_speed = 1 / 150.0;
real_t pan_speed = translation_sensitivity / 150.0;
if (p_event.is_valid() && nav_scheme == NAVIGATION_MAYA && p_event->is_shift_pressed()) {
pan_speed *= 10;
}
Expand Down

0 comments on commit fb4d401

Please sign in to comment.