fix cam sensitivity

This commit is contained in:
2023-11-15 18:42:03 +01:00
parent 4519bd3fcb
commit 0ca47817d9

View File

@@ -9,10 +9,10 @@ namespace blitz {
namespace render {
void Camera::Update(float delta) {
static const float MouseSpeed = 0.0025f;
if (ImGui::GetIO().MouseDown[0]) {
// slower when more fps. why ?
m_Yaw += ImGui::GetIO().MouseDelta.x * delta * 0.2f;
m_Pitch -= ImGui::GetIO().MouseDelta.y * delta * 0.2f;
m_Yaw += ImGui::GetIO().MouseDelta.x * MouseSpeed;
m_Pitch -= ImGui::GetIO().MouseDelta.y * MouseSpeed;
m_Pitch = std::clamp(m_Pitch, -maths::PI / 2.0f + 0.001f, maths::PI / 2.0f - 0.001f);
}