From 8a0b2a59c9809d5fc8e6a30c2abc4d5af21aa39e Mon Sep 17 00:00:00 2001 From: hachem Date: Wed, 13 Aug 2025 18:39:13 +0200 Subject: [fix]: More consistent formatting --- src/Core/Camera.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/Core/Camera.cpp') diff --git a/src/Core/Camera.cpp b/src/Core/Camera.cpp index ea363b0..ecfb6df 100644 --- a/src/Core/Camera.cpp +++ b/src/Core/Camera.cpp @@ -28,27 +28,27 @@ namespace Donut void Camera::RecalculateViewMatrix() { float pitch = glm::radians(m_Rotation.x); - float yaw = glm::radians(m_Rotation.y); - float roll = glm::radians(m_Rotation.z); + float yaw = glm::radians(m_Rotation.y); + float roll = glm::radians(m_Rotation.z); glm::vec3 direction; direction.x = cos(yaw) * cos(pitch); direction.y = sin(pitch); direction.z = sin(yaw) * cos(pitch); - glm::vec3 front = glm::normalize(direction); glm::vec3 worldUp(0.0f, 1.0f, 0.0f); + glm::vec3 front = glm::normalize(direction); glm::vec3 right = glm::normalize(glm::cross(front, worldUp)); - glm::vec3 up = glm::normalize(glm::cross(right, front)); + glm::vec3 up = glm::normalize(glm::cross(right, front)); - m_ViewMatrix = glm::lookAt(m_Position, m_Position + front, up); + m_ViewMatrix = glm::lookAt(m_Position, m_Position + front, up); m_ViewProjectionMatrix = m_ProjectionMatrix * m_ViewMatrix; } glm::vec3 Camera::GetForwardDirection() const { float pitch = glm::radians(m_Rotation.x); - float yaw = glm::radians(m_Rotation.y); + float yaw = glm::radians(m_Rotation.y); glm::vec3 direction; direction.x = cos(yaw) * cos(pitch); @@ -69,10 +69,6 @@ namespace Donut return glm::normalize(glm::cross(GetRightDirection(), GetForwardDirection())); } - void Camera::OnUpdate(float deltaTime) - { - } - void Camera::OnMouseMove(float xOffset, float yOffset, bool constrainPitch) { xOffset *= m_MouseSensitivity; -- cgit v1.3