GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LightSource.hpp
Go to the documentation of this file.
1 #ifndef RADIX_COMPONENT_LIGHTSOURCE_HPP
2 #define RADIX_COMPONENT_LIGHTSOURCE_HPP
3 
5 
6 #include <serine/Archiver.hpp>
7 
9 
10 namespace radix {
11 
12 class LightSource : public Component {
13 public:
14  bool enabled;
16  float distance;
17  float energy;
18  float specular;
19 
21  Component(ent),
22  enabled(true),
23  color(1, 1, 1),
24  distance(1),
25  energy(10),
26  specular(1) {
27  }
28 
29  const char* getName() const {
30  return "LightSource";
31  }
32 
33  TypeId getTypeId() const {
34  return Component::getTypeId<std::remove_reference<decltype(*this)>::type>();
35  }
36 
37  void serialize(serine::Archiver &ar) {
38  ar("enabled", enabled);
39  ar("color", color);
40  ar("distance", distance);
41  ar("energy", energy);
42  ar("specular", specular);
43  }
44 };
45 
46 } /* namespace radix */
47 
48 #endif /* RADIX_COMPONENT_LIGHTSOURCE_HPP */
Definition: GameController.hpp:7
ECS entity, Component container It is created like this:
Definition: Entity.hpp:23
float specular
Definition: LightSource.hpp:18
LightSource(Entity &ent)
Definition: LightSource.hpp:20
Vector3f color
Definition: LightSource.hpp:15
Base class to create entity components.
Definition: Component.hpp:25
TypeId getTypeId() const
Definition: LightSource.hpp:33
void serialize(serine::Archiver &ar)
Definition: LightSource.hpp:37
ComponentTypeId TypeId
Definition: Component.hpp:35
float energy
Definition: LightSource.hpp:17
Definition: LightSource.hpp:12
float distance
Definition: LightSource.hpp:16
bool enabled
Definition: LightSource.hpp:14
3-dimensional float-based vector/point storage and manipulation struct
Definition: Vector3f.hpp:27
const char * getName() const
Definition: LightSource.hpp:29