Tramway SDK v0.1.1
light.h
Go to the documentation of this file.
1// Tramway Drifting and Dungeon Exploration Simulator SDK Runtime
2
3#ifndef TRAM_SDK_RENDER_LIGHT_H
4#define TRAM_SDK_RENDER_LIGHT_H
5
6#include <render/render.h>
8
9#include <vector>
10
11namespace tram::Render {
12
13class Material;
14
15class LightGraph : public Resource {
16public:
18
19 void LoadFromDisk();
21
22 void Unload() {}
23
24 std::vector<std::pair<uint32_t, vec3>> GetEnvironmentProbes();
25
26 static bool ContainsEntity(id_t entity);
27 static SphericalHarmonic LookupHarmonic(vec3 position, uint32_t layers);
28 static Material* LookupEnvironmentMap(vec3 position);
29 static LightGraph* Find(name_t name);
30protected:
31 struct Node {
33 bool has_light = false;
34 bool has_reflection = false;
36 std::vector<SphericalHarmonic> constants;
37 };
38
39 std::vector<id_t> entities;
40 std::vector<Node> nodes;
41 std::vector<std::pair<uint32_t, uint32_t>> edges;
42};
43
44}
45
46#endif // TRAM_SDK_RENDER_LIGHT_H
LightGraph resource.
Definition: light.h:15
std::vector< std::pair< uint32_t, uint32_t > > edges
Definition: light.h:41
std::vector< std::pair< uint32_t, vec3 > > GetEnvironmentProbes()
Definition: light.cpp:45
static Material * LookupEnvironmentMap(vec3 position)
Definition: light.cpp:51
LightGraph(name_t name)
Definition: light.h:17
static LightGraph * Find(name_t name)
Definition: light.cpp:149
static bool ContainsEntity(id_t entity)
Definition: light.cpp:36
std::vector< id_t > entities
Definition: light.h:39
void Unload()
Definition: light.h:22
void LoadFromDisk()
Definition: light.cpp:160
static SphericalHarmonic LookupHarmonic(vec3 position, uint32_t layers)
Definition: light.cpp:70
std::vector< Node > nodes
Definition: light.h:40
void LoadFromMemory()
Definition: light.h:20
Material resource.
Definition: material.h:31
Definition: resource.h:11
name_t name
Definition: resource.h:37
High-level Render system API.
Definition: gui.h:8
uint32_t id_t
Definition: core.h:10
glm::vec3 vec3
Definition: math.h:11
Definition: light.h:31
bool has_reflection
Definition: light.h:34
bool has_light
Definition: light.h:33
std::vector< SphericalHarmonic > constants
Definition: light.h:36
vec3 position
Definition: light.h:32
Material * environment_map
Definition: light.h:35
Definition: render.h:92
Interned string type.
Definition: uid.h:10