fix: camera cannot pan left or right

This commit is contained in:
2026-03-21 13:07:28 +08:00
parent 772d606bbe
commit e2f0e7ea66
6 changed files with 24 additions and 5 deletions

View File

@@ -280,6 +280,7 @@ void Player::update_front_vec(float offset_x, float offset_y) {
m_yaw += offset_x * m_sensitivity;
m_pitch += offset_y * m_sensitivity;
m_yaw = std::fmod(m_yaw, 360.0);
if (m_pitch > 89.0f) m_pitch = 89.0f;
if (m_pitch < -89.0f) m_pitch = -89.0f;