diff options
Diffstat (limited to 'src/Engine')
| -rw-r--r-- | src/Engine/Engine.h | 6 | ||||
| -rw-r--r-- | src/Engine/Object.h | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/Engine/Engine.h b/src/Engine/Engine.h index e1b4ad8..7b4ced4 100644 --- a/src/Engine/Engine.h +++ b/src/Engine/Engine.h @@ -1,6 +1,7 @@ #pragma once #include <vector> +#include <numbers> #include <iostream> #include <fstream> #include <sstream> @@ -21,11 +22,6 @@ #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> -#define _USE_MATH_DEFINES -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - namespace Donut { const double c = 299792458.0; diff --git a/src/Engine/Object.h b/src/Engine/Object.h index ea672db..7e620c4 100644 --- a/src/Engine/Object.h +++ b/src/Engine/Object.h @@ -46,7 +46,7 @@ namespace Donut float a = glm::dot(ray.m_Direction, ray.m_Direction); float b = 2.0f * glm::dot(oc, ray.m_Direction); float c = glm::dot(oc, oc) - m_Radius * m_Radius; - double discriminant = b*b - 4*a*c; + float discriminant = static_cast<float>(b*b - 4*a*c); if(discriminant < 0) return false; |
