hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/engine/object.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-14 18:21:00 +0200
committerhachem <im@hachem.wtf>2025-08-14 18:21:00 +0200
commit3d8d3259e1cf5a7d88e5d1e530cc8c9bf9140734 (patch)
tree450b674caaf60327104aa76375c045f1f8f77076 /src/engine/object.h
parent79045760ce6100b4c87846d793f9dceeba4c9c36 (diff)
feat: I am going to throw my computer out a window
Diffstat (limited to 'src/engine/object.h')
-rw-r--r--src/engine/object.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/engine/object.h b/src/engine/object.h
new file mode 100644
index 0000000..5f5d86f
--- /dev/null
+++ b/src/engine/object.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <glm/glm.hpp>
+
+namespace Donut
+{
+ class Ray
+ {
+ public:
+ glm::vec3 m_direction;
+ glm::vec3 m_origin;
+
+ Ray(glm::vec3 o, glm::vec3 d);
+ };
+
+ class Material
+ {
+ public:
+ glm::vec3 m_color;
+ float m_specular;
+ float m_emission;
+
+ Material(glm::vec3 c, float s, float e);
+ };
+
+ class Object
+ {
+ public:
+ glm::vec3 m_centre;
+ float m_radius;
+ Material m_material;
+
+ Object(glm::vec3 c, float r, Material m);
+
+ bool intersect(Ray &ray, float &t);
+ glm::vec3 get_normal(glm::vec3 &point) const;
+ };
+};