diff options
| author | toger5 | 2017-09-19 01:30:14 +0200 |
|---|---|---|
| committer | toger5 | 2017-09-19 01:30:14 +0200 |
| commit | 81245a634b9dff041b0f2373c643166267a03857 (patch) | |
| tree | e980aa62000e8456268abb5c2ef02e5c1687b719 /editor/plugins/spatial_editor_plugin.cpp | |
| parent | 3d06957f12ba5c04702f3db980af9c07142e7886 (diff) | |
| download | godot-81245a634b9dff041b0f2373c643166267a03857.tar.gz godot-81245a634b9dff041b0f2373c643166267a03857.tar.zst godot-81245a634b9dff041b0f2373c643166267a03857.zip | |
zoom inertia uses its own setting (not the same then translation)
Diffstat (limited to '')
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index a6ab36ed2..f50e79217 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -83,6 +83,8 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { float manip_orbit_inertia = EDITOR_DEF("editors/3d/manipulation_orbit_inertia", 0.075); float manip_translation_inertia = EDITOR_DEF("editors/3d/manipulation_translation_inertia", 0.075); + float zoom_inertia = EDITOR_DEF("editors/3d/zoom_inertia", 0.0); + //determine if being manipulated bool manipulated = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); @@ -96,7 +98,7 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { camera_cursor.y_rot = Math::lerp(old_camera_cursor.y_rot, cursor.y_rot, MIN(1.f, p_interp_delta * (1 / orbit_inertia))); camera_cursor.pos = old_camera_cursor.pos.linear_interpolate(cursor.pos, MIN(1.f, p_interp_delta * (1 / translation_inertia))); - camera_cursor.distance = Math::lerp(old_camera_cursor.distance, cursor.distance, MIN(1.f, p_interp_delta * (1 / translation_inertia))); + camera_cursor.distance = Math::lerp(old_camera_cursor.distance, cursor.distance, MIN(1.f, p_interp_delta * (1 / zoom_inertia))); if (p_interp_delta == 0 || is_freelook_active()) { camera_cursor = cursor; |
