diff --git a/src/utilities/camera.hpp b/src/utilities/camera.hpp index bbfe338..44d7973 100644 --- a/src/utilities/camera.hpp +++ b/src/utilities/camera.hpp @@ -84,8 +84,8 @@ namespace Gloom } // Keep track of pitch and yaw for the current frame - fYaw = xpos - lastXPos; - fPitch = ypos - lastYPos; + fYaw = (xpos - lastXPos) * cMouseSensitivity; + fPitch = (ypos - lastYPos) * cMouseSensitivity; // Update last known cursor position lastXPos = xpos; @@ -143,10 +143,6 @@ namespace Gloom /* Update the view matrix based on the current information */ void updateViewMatrix() { - // Adjust cursor movement using the specified sensitivity - fPitch *= cMouseSensitivity; - fYaw *= cMouseSensitivity; - // Create quaternions given the current pitch and yaw glm::quat qPitch = glm::quat(glm::vec3(fPitch, 0.0f, 0.0f)); glm::quat qYaw = glm::quat(glm::vec3(0.0f, fYaw, 0.0f)); @@ -156,7 +152,7 @@ namespace Gloom fYaw = 0.0f; // Update camera quaternion and normalise - cQuaternion = qYaw * qPitch * cQuaternion; + cQuaternion = qPitch * qYaw * cQuaternion; cQuaternion = glm::normalize(cQuaternion); // Build rotation matrix using the camera quaternion