diff options
| author | Juan Linietsky | 2017-08-26 09:10:57 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-08-26 09:10:57 -0300 |
| commit | fbfed97a1b4b805a7363e0f8e28041bd443d3a30 (patch) | |
| tree | 8348c611d21a3fa6d31d4d4a6b3a8003b0db57b3 /editor/plugins/spatial_editor_plugin.cpp | |
| parent | 1894157c9fab05984428d83a743b0fe1d720c80c (diff) | |
| download | godot-fbfed97a1b4b805a7363e0f8e28041bd443d3a30.tar.gz godot-fbfed97a1b4b805a7363e0f8e28041bd443d3a30.tar.zst godot-fbfed97a1b4b805a7363e0f8e28041bd443d3a30.zip | |
Changed camera interpolation to work when LMB is pressed and no modifiers are pressed
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
| -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 e2c8caae1..607052231 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -74,7 +74,9 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { Transform old_transform = camera->get_global_transform(); Transform transform; - if (p_interp_delta && Input::get_singleton()->get_mouse_button_mask() == 0) { + bool disable_interp = (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); + + if (p_interp_delta && !disable_interp) { //interpolate float interp_speed = 14; //maybe should be made configuration transform = old_transform.interpolate_with(new_transform, MIN(1.0, p_interp_delta * interp_speed)); |
