Merge pull request #56449 from Calinou/3d-editor-split-freelook-sensitivity-setting-3.x

Split 3D editor sensitivity freelook sensitivity into its own setting (3.x)
This commit is contained in:
Rémi Verschelde 2022-01-04 00:29:32 +01:00 committed by GitHub
commit 22a7e6b120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -574,6 +574,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
// 3D: Freelook
_initial_set("editors/3d/freelook/freelook_navigation_scheme", false);
hints["editors/3d/freelook/freelook_navigation_scheme"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_navigation_scheme", PROPERTY_HINT_ENUM, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)");
_initial_set("editors/3d/freelook/freelook_sensitivity", 0.25);
hints["editors/3d/freelook/freelook_sensitivity"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_sensitivity", PROPERTY_HINT_RANGE, "0.01, 2, 0.001");
_initial_set("editors/3d/freelook/freelook_inertia", 0.0);
hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0, 1, 0.001");
_initial_set("editors/3d/freelook/freelook_base_speed", 5.0);

View file

@ -2253,7 +2253,8 @@ void SpatialEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, cons
_menu_option(VIEW_PERSPECTIVE);
}
const real_t degrees_per_pixel = EditorSettings::get_singleton()->get("editors/3d/navigation_feel/orbit_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");