Tramway SDK
light.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
5#define TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
6
8#include <render/render.h>
9
10namespace tram {
11
13public:
14 void Init ();
15 void Start () {}
16
19 void SetDistance(float dist);
21 void SetExponent(float exponent);
22
23 vec3 GetColor();
24 float GetDistance();
25
26 void EventHandler(Event &event) { return; }
28protected:
29 void Update();
30
32 vec3 location = {0.0f, 0.0f, 0.0f};
33 Render::color_t color = {1.0f, 1.0f, 1.0f};
34 float distance = 15.0f;
35 vec3 direction = {0.0f, 0.0f, -1.0f};
36 float exponent = 0.0f;
37};
38
39}
40
41#endif // TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
Definition: entitycomponent.h:18
Definition: light.h:12
float GetDistance()
Returns the distance of the light.
Definition: light.cpp:72
void SetDistance(float dist)
Sets the distance of the light.
Definition: light.cpp:51
~LightComponent()
Definition: light.cpp:21
void SetLocation(vec3 location)
Sets the location of the light.
Definition: light.cpp:38
void SetDirection(vec3 direction)
Definition: light.cpp:56
void Init()
Definition: light.cpp:10
vec3 GetColor()
Returns the color of the light.
Definition: light.cpp:67
Render::color_t color
Definition: light.h:33
float distance
Definition: light.h:34
void EventHandler(Event &event)
Definition: light.h:26
void SetExponent(float exponent)
Definition: light.cpp:61
void SetColor(Render::color_t color)
Sets the color of the light.
Definition: light.cpp:44
Render::light_t light
Definition: light.h:31
void Update()
Definition: light.cpp:29
vec3 direction
Definition: light.h:35
void Start()
Definition: light.h:15
float exponent
Definition: light.h:36
vec3 location
Definition: light.h:32
vec3 color_t
Definition: render.h:17
Definition: api.h:9
glm::vec3 vec3
Definition: math.h:12
Definition: event.h:24
Definition: render.h:155
void * generic
Definition: render.h:160