aboutsummaryrefslogtreecommitdiff
path: root/src/Engine
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-18 05:02:13 +0200
committerhachem <im@hachem.wtf>2025-08-18 05:02:13 +0200
commitd34925777dd4fac709096f1c18b7d886b43c15b2 (patch)
treefac4c30a28784672c701898ff7612dbdfe530d49 /src/Engine
parent1ecaea469e86ef3f5d18122c8b2cc187286e27f7 (diff)
[fix]: improvements, bump to c++20 and fix bugs
Diffstat (limited to 'src/Engine')
-rw-r--r--src/Engine/Engine.h6
-rw-r--r--src/Engine/Object.h2
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;