24 unsigned int vertex_array_object;
25 std::shared_ptr<Shader> shader;
26 std::map<unsigned int, std::shared_ptr<BaseTexture>> textures;
31 std::list<std::shared_ptr<Light>> influencing_lights;
32 glm::vec3 ambient_light;
33 float ambient_intensity;
74 void setShader(std::shared_ptr<Shader> shader_object) noexcept;
80 std::shared_ptr<Shader>
getShader() const noexcept;
89 void addTexture(const
unsigned int unit, const std::
string uniform_name, std::shared_ptr<
BaseTexture> texture_object) noexcept;
157 virtual std::
string to_string() const noexcept override;
159 virtual std::
string className() const noexcept override;
184 virtual
void onStart() override;
185 virtual
bool onUpdate(const
double delta) override;
188 void onNotifyNow(std::shared_ptr<Events::Event> event) override;
191 virtual
void log(el::base::type::ostream_t& os) const override;
virtual void onDestroy() override
Called when the engine is shutting down.
Definition: renderable.cpp:146
virtual std::string className() const noexceptoverride
Returns a string representing the class name.
Definition: renderable.cpp:255
void addTexture(const unsigned int unit, const std::string uniform_name, std::shared_ptr< BaseTexture > texture_object) noexcept
Adds a texture.
Definition: renderable.cpp:63
void setAmbientIntensity(const float intensity) noexcept
Sets the ambient intensity.
Definition: renderable.cpp:95
Base Class for all components.
Definition: component.h:20
float highestZ() const noexcept
The highest possible z value in the renderable.
Definition: renderable.cpp:111
void setLightReactive(const bool reactive) noexcept
Sets if the renderable should be light reactive.
Definition: renderable.cpp:79
float getAmbientIntensity() const noexcept
Gets the ambient intensity.
Definition: renderable.cpp:99
Class for renderable.
Definition: renderable.h:22
bool isLightReactive() const noexcept
Determines if light reactive.
Definition: renderable.cpp:83
std::set< Uniform > uniforms
Definition: renderable.h:37
void setAmbientLight(const glm::vec3 color) noexcept
Sets the ambient light.
Definition: renderable.cpp:87
void clearInfluencingLights()
Clears all influencing lights.
Definition: renderable.cpp:107
virtual bool onUpdate(const double delta) override
Called every engine loop.
Definition: renderable.cpp:165
Class for vertex data.
Definition: vertex_data.h:17
glm::vec3 getAmbientLight() const noexcept
Gets the ambient light.
Definition: renderable.cpp:91
Renderable operator=(Renderable &)=delete
virtual void onStart() override
Called when the engine starts and when a new scene is loaded.
Definition: renderable.cpp:152
Class for base texture.
Definition: base_texture.h:16
std::map< unsigned int, std::shared_ptr< BaseTexture > > getTextures() const noexcept
Gets the textures.
Definition: renderable.cpp:75
void setShader(std::shared_ptr< Shader > shader_object) noexcept
Sets the shader.
Definition: renderable.cpp:55
virtual void log(el::base::type::ostream_t &os) const override
Definition: renderable.cpp:269
virtual unsigned long long getValueForSorting() const noexceptoverride
Gets the value for sorting.
Definition: renderable.cpp:250
VertexData getVertexData() const noexcept
Gets the vertex data.
Definition: renderable.cpp:119
void removeTexture(const unsigned int unit)
Removes a texture.
Definition: renderable.cpp:71
std::shared_ptr< Shader > getShader() const noexcept
Gets the shader.
Definition: renderable.cpp:59
Class for light.
Definition: light.h:15
virtual ~Renderable()
Definition: renderable.cpp:51
static std::shared_ptr< Renderable > create(const VertexData &vertex_data)
Renderable factory function.
Definition: renderable.cpp:30
void setUniform(const Uniform &uniform) noexcept
Definition: renderable.cpp:132
void onNotifyNow(std::shared_ptr< Events::Event > event) override
When receiving an event that is immediate, onNotifyNow is used. It acts as an interrupt to make sure ...
Definition: renderable.cpp:246
void addInfluencingLight(std::shared_ptr< Light > light) noexcept
Adds an influencing light.
Definition: renderable.cpp:103
Renderable()
Definition: renderable.h:39
virtual std::string to_string() const noexceptoverride
Returns a string representation of the object.
Definition: renderable.cpp:259
void handleQueuedEvent(std::shared_ptr< Events::Event > event) override
HandleQueuedEvent allows derived classes to define behaviour for when queuedEvents are received...
Definition: renderable.cpp:226
unsigned int getVertexArrayBinding() const noexcept
Gets the vertex array binding.
Definition: renderable.cpp:115