aboutsummaryrefslogtreecommitdiff
path: root/src/Engine/Object.h
blob: 0ae34303fc5a2b6cddb3ccd08d34c587436a317d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 GetNormal(glm::vec3 &point) const;
    };
};