diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/camera.cpp | 4 | ||||
| -rw-r--r-- | src/core/camera.h | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/core/camera.cpp b/src/core/camera.cpp index bba6ee2..9c2b061 100644 --- a/src/core/camera.cpp +++ b/src/core/camera.cpp @@ -163,7 +163,7 @@ namespace Donut glm::vec3 Camera::get_orbital_position() const { - float clamped_elevation = glm::clamp(m_elevation, 0.01f, float(M_PI) - 0.01f); + float clamped_elevation = glm::clamp(m_elevation, 0.01f, float(std::numbers::pi) - 0.01f); return glm::vec3 ( m_orbital_radius * sin(clamped_elevation) * cos(m_azimuth), @@ -191,7 +191,7 @@ namespace Donut m_azimuth += dx * m_orbital_speed; m_elevation -= dy * m_orbital_speed; - m_elevation = glm::clamp(m_elevation, 0.01f, float(M_PI) - 0.01f); + m_elevation = glm::clamp(m_elevation, 0.01f, float(std::numbers::pi) - 0.01f); } m_last_x_orbital = x; diff --git a/src/core/camera.h b/src/core/camera.h index 809be48..677cb71 100644 --- a/src/core/camera.h +++ b/src/core/camera.h @@ -3,10 +3,7 @@ #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> -#define _USE_MATH_DEFINES -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif +#include <numbers> namespace Donut { @@ -121,7 +118,7 @@ namespace Donut double m_orbital_min_radius = 1e10; double m_orbital_max_radius = 1e12; float m_azimuth = 0.0f; - float m_elevation = static_cast<float>(M_PI) / 2.0f; + float m_elevation = static_cast<float>(std::numbers::pi) / 2.0f; float m_orbital_speed = 0.01f; double m_zoom_speed = 25e9f; bool m_dragging = false; |
