Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
LightComponent.cpp
Go to the documentation of this file.
1#include "scene/components/LightComponent.h"
2
3namespace eng
4{
5 void LightComponent::LoadProperties(const nlohmann::json& json)
6 {
7 if (json.contains("color"))
8 {
9 const auto& colorObj = json["color"];
10 glm::vec3 color(
11 colorObj.value("r", 1.0f),
12 colorObj.value("g", 1.0f),
13 colorObj.value("b", 1.0f)
14 );
15 SetColor(color);
16 }
17 }
18
19 void LightComponent::Update(float deltaTime)
20 {
21 }
22
23 void LightComponent::SetColor(const glm::vec3& color)
24 {
25 m_color = color;
26 }
27
28 const glm::vec3& LightComponent::GetColor() const
29 {
30 return m_color;
31 }
32}
void LoadProperties(const nlohmann::json &json) override
void Update(float deltaTime) override
const glm::vec3 & GetColor() const
void SetColor(const glm::vec3 &color)