Tramway SDK
light.h
Go to the documentation of this file.
1// Tramway Drifting and Dungeon Exploration Simulator SDK Runtime
2
3#ifndef TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
4#define TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
5
7#include <components/render.h>
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; }
28
29 static bool IsLightDraw();
30 static void SetLightDraw(bool);
31protected:
32 void Update();
33
35 vec3 location = {0.0f, 0.0f, 0.0f};
36 Render::color_t color = {1.0f, 1.0f, 1.0f};
37 float distance = 15.0f;
38 vec3 direction = {0.0f, 0.0f, -1.0f};
39 float exponent = 0.0f;
40
41 void SetupModel();
43};
44
45}
46
47#endif // TRAM_SDK_COMPONENTS_LIGHTCOMPONENT_H
Wrapper for an EntityComponent pointer.
Definition: entitycomponent.h:51
Component base class.
Definition: entitycomponent.h:16
Provides a real-time illumination for the scene.
Definition: light.h:12
float GetDistance()
Returns the distance of the light.
Definition: light.cpp:96
void SetDistance(float dist)
Sets the distance of the light.
Definition: light.cpp:75
Component< RenderComponent > model
Definition: light.h:42
~LightComponent()
Definition: light.cpp:40
void SetLocation(vec3 location)
Sets the location of the light.
Definition: light.cpp:62
void SetDirection(vec3 direction)
Definition: light.cpp:80
static void SetLightDraw(bool)
Sets the drawing oflights.
Definition: light.cpp:126
void Init()
Initializes an entity component.
Definition: light.cpp:27
vec3 GetColor()
Returns the color of the light.
Definition: light.cpp:91
Render::color_t color
Definition: light.h:36
float distance
Definition: light.h:37
void EventHandler(Event &event)
Definition: light.h:26
void SetExponent(float exponent)
Definition: light.cpp:85
void SetColor(Render::color_t color)
Sets the color of the light.
Definition: light.cpp:68
Render::light_t light
Definition: light.h:34
void Update()
Definition: light.cpp:48
vec3 direction
Definition: light.h:38
void SetupModel()
Definition: light.cpp:102
void Start()
Definition: light.h:15
static bool IsLightDraw()
Checks whether the lights are drawn.
Definition: light.cpp:119
float exponent
Definition: light.h:39
vec3 location
Definition: light.h:35
vec3 color_t
Definition: render.h:16
Serialization, i.e.
glm::vec3 vec3
Definition: math.h:11
Event data.
Definition: event.h:24
Definition: render.h:166