If you rotate the camera at 90 degrees or -90 degrees you will flip side upside down, so I fixed it in the FPSCamera.cpp file.
it looked like this:
if (m_MouseWasGrabbed)
{
m_Yaw += mouse.x * m_MouseSensitivity;
m_Pitch += mouse.y * m_MouseSensitivity;
}
so I changed it to this:
if (m_MouseWasGrabbed)
{
m_Yaw += mouse.x * m_MouseSensitivity;
m_Pitch += mouse.y * m_MouseSensitivity;
if (m_Pitch < -1.5f) m_Pitch = -1.5f;
if (m_Pitch > 1.75f) m_Pitch = 1.75f;
}
If you rotate the camera at 90 degrees or -90 degrees you will flip side upside down, so I fixed it in the FPSCamera.cpp file. it looked like this: if (m_MouseWasGrabbed) { m_Yaw += mouse.x * m_MouseSensitivity; m_Pitch += mouse.y * m_MouseSensitivity; } so I changed it to this: if (m_MouseWasGrabbed) { m_Yaw += mouse.x * m_MouseSensitivity; m_Pitch += mouse.y * m_MouseSensitivity; if (m_Pitch < -1.5f) m_Pitch = -1.5f; if (m_Pitch > 1.75f) m_Pitch = 1.75f; }