diff options
Diffstat (limited to 'src/engine/object.h')
| -rw-r--r-- | src/engine/object.h | 38 |
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; + }; +}; |
