clamp camera + pi

This commit is contained in:
2023-06-06 17:15:44 +02:00
parent e984ed9085
commit c95c8b7fde
3 changed files with 7 additions and 4 deletions

View File

@@ -93,8 +93,8 @@ void Renderer::SetZoom(float zoom) {
}
void Renderer::SetCamMovement(const Vec2f& mov) {
m_Camera.m_Pitch -= mov.y / 50.0f;
m_Camera.m_Yaw += mov.x / 50.0f;
m_Camera.m_Pitch = std::clamp(m_Camera.m_Pitch - mov.y / m_MouseSensitivity, -PI / 2.0f + 0.0000001f, -PI / 12.0f );
m_Camera.m_Yaw += mov.x / m_MouseSensitivity;
SetCamLook(m_Camera.CamLook);
}