use cpp20 numbers for pi

This commit is contained in:
Georg Hagen
2024-07-14 00:10:08 +02:00
parent 5432711d8a
commit 410ac5d63c

View File

@@ -15,7 +15,7 @@
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtx/io.hpp>
#include <math.h>
#include <numbers>
namespace OpenVulkano::Math
{
@@ -26,7 +26,7 @@ namespace OpenVulkano::Math
template<typename T, typename = std::enable_if_t<std::is_floating_point_v<T>>>
constexpr T Radians(T degree)
{
constexpr T CONVERSION = M_PI / 180.0;
constexpr T CONVERSION = std::numbers::pi_v<T> / 180.0;
return degree * CONVERSION;
}
}