1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Implement Alt + Mouse wheel to adjust FOV in the 3D editor viewport

This allows for quicker FOV adjustments compared to using the View menu.
This commit is contained in:
Hugo Locurcio
2021-10-25 00:39:50 +02:00
parent c3bdcb4516
commit a094e5dcdf
2 changed files with 57 additions and 10 deletions

View File

@@ -378,7 +378,7 @@ private:
struct Cursor {
Vector3 pos;
float x_rot, y_rot, distance;
float x_rot, y_rot, distance, fov_scale;
Vector3 eye_pos; // Used in freelook mode
bool region_select;
Point2 region_begin, region_end;
@@ -388,6 +388,7 @@ private:
x_rot = 0.5;
y_rot = -0.5;
distance = 4;
fov_scale = 1.0;
region_select = false;
}
};
@@ -396,6 +397,8 @@ private:
Cursor cursor; // Immediate cursor
Cursor camera_cursor; // That one may be interpolated (don't modify this one except for smoothing purposes)
void scale_fov(real_t p_fov_offset);
void reset_fov();
void scale_cursor_distance(real_t scale);
void set_freelook_active(bool active_now);
@@ -412,7 +415,7 @@ private:
void set_message(String p_message, float p_time = 5);
//
void _view_settings_confirmed(float p_interp_delta);
void _update_camera(float p_interp_delta);
Transform to_camera_transform(const Cursor &p_cursor) const;
void _draw();