diff options
| author | hachem <im@hachem.wtf> | 2025-08-13 18:39:13 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-13 18:39:13 +0200 |
| commit | 8a0b2a59c9809d5fc8e6a30c2abc4d5af21aa39e (patch) | |
| tree | 41adf621418b790100d207c1534236945b431d1e /src/Core/Camera.cpp | |
| parent | f1517709556827fb8b7bab00bdee4a9794d88dd1 (diff) | |
[fix]: More consistent formatting
Diffstat (limited to 'src/Core/Camera.cpp')
| -rw-r--r-- | src/Core/Camera.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
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; |
