Radium Engine  1.5.20
Loading...
Searching...
No Matches
Light.cpp
1#include <Engine/Scene/Light.hpp>
2
3#include <Core/Containers/VariableSetEnumManagement.hpp>
4#include <Engine/Data/RenderParameters.hpp>
5#include <Engine/RadiumEngine.hpp>
6
7namespace Ra {
8namespace Engine {
9namespace Scene {
10Light::Light( Scene::Entity* entity, const LightType& type, const std::string& name ) :
11 Component( name, entity ), m_type( type ) {
12 Core::VariableSetEnumManagement::setEnumVariable( m_params, "light.type", m_type );
13 m_params.setVariable( "light.color", m_color );
14}
15
17 params.mergeReplaceVariables( m_params );
18}
19
21 // Nothing to do.
22}
23
25 return {};
26}
27
28} // namespace Scene
29} // namespace Engine
30} // namespace Ra
void mergeReplaceVariables(const VariableSet &from)
Merge the VariableSet from into this.
Management of shader parameters with automatic binding of a named parameter to the corresponding glsl...
void setVariable(const std::string &name, RenderParameters &rp)
overload create ref wrapper for RenderParameters variable
A component is an element that can be updated by a system. It is also linked to some other components...
Definition Component.hpp:31
An entity is an scene element. It ties together components with a transform.
Definition Entity.hpp:23
Light(Entity *entity, const LightType &type, const std::string &name="light")
Definition Light.cpp:10
virtual std::string getShaderInclude() const
Definition Light.cpp:24
const Data::RenderParameters & getRenderParameters() const
Gives read-only access to the renderParameters of the light.
Definition Light.hpp:93
void initialize() override
Definition Light.cpp:20
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3