|
@@ -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;
|