Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Optimize] Fix editor camera is too sensitive for 4k monitor/screen #154

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions engine/source/editor/source/editor_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ namespace Pilot
if (!m_is_editor_mode)
return;

constexpr float angularVelocity = 180.0f / 600.0f; // degrees/pixel
float angularVelocity = 180.0f / Math::max(m_engine_window_size.x, m_engine_window_size.y); // 180 degrees while moving full screen
if (m_mouse_x >= 0.0f && m_mouse_y >= 0.0f)
{
if (m_io->isMouseButtonDown(GLFW_MOUSE_BUTTON_RIGHT))
Expand Down Expand Up @@ -1041,7 +1041,7 @@ namespace Pilot
if (selected_object == nullptr)
return;

constexpr float angularVelocity = 18.0f / 600.0f;
float angularVelocity = 18.0f / Math::max(m_engine_window_size.x, m_engine_window_size.y); // 18 degrees while moving full screen
Vector2 delta_mouse_move_uv = {(new_mouse_pos_x - last_mouse_pos_x), (new_mouse_pos_y - last_mouse_pos_y)};

Vector3 model_scale;
Expand Down