summaryrefslogtreecommitdiff
path: root/engine-ocean/Graphics/light.h
blob: 0c42b7f589a0d35c37503d1d511b43d5f96a6911 (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
39
40
41
42
#pragma once

#include "glm/glm.hpp"
#include "glm/ext.hpp"

enum LightType{
    POINT,
    DIRECTIONAL
};

class Light{
public:
    Light(LightType type, glm::vec3 lightData, glm::vec3 lightColor = glm::vec3(1));
    ~Light();

    // Functions for point lights
    void setPos(glm::vec3 newPos);
    glm::vec3 getPos();
    void translate(glm::vec3 delta);
    void setAttenuation(glm::vec3 attenuation);
    glm::vec3 getAttenuation();

    // Functions for directional lights
    void setDir(glm::vec3 newDir);
    glm::vec3 getDir();
    void rotate(float angle, glm::vec3 axis);

    // Utility functions for light color
    void setColor(glm::vec3 newColor);
    glm::vec3 getColor();

    // Utility functions for the light type
    void setType(LightType newType);
    LightType getType();

private:
    LightType m_lightType;
    glm::vec3 m_lightPos;
    glm::vec3 m_lightDir;
    glm::vec3 m_lightColor;
    glm::vec3 m_lightFunction;
};