|
Monad Engine da02fba2
> Undercity Codex_
|
Point light that contributes position + colour to the render pass. More...
#include <LightComponent.h>
Inheritance diagram for mnd::LightComponent:
Collaboration diagram for mnd::LightComponent:Public Member Functions | |
| void | Update (f32 deltaTime) override |
| No per-frame computation needed; position is queried from owner on demand. | |
| const vec3 & | GetColor () const |
| Returns the linear RGB colour of this light (default: white {1,1,1}). | |
| void | LoadProperties (const nlohmann::json &json) override |
| void | SetColor (const vec3 &color) |
| Set the light's emission colour. | |
| virtual void | Init () |
| virtual size_t | GetTypeId () const =0 |
| GameObject * | GetOwner () |
Static Public Member Functions | |
| template<typename T > | |
| static size_t | StaticTypeId () |
Protected Attributes | |
| GameObject * | m_owner = nullptr |
Point light that contributes position + colour to the render pass.
The world-space position is read from the owner GameObject's transform. Multiple LightComponents in the same scene are all collected and passed to every shader as a uniform array.
Definition at line 39 of file LightComponent.h.
| const vec3 & mnd::LightComponent::GetColor | ( | ) | const |
Returns the linear RGB colour of this light (default: white {1,1,1}).
Definition at line 22 of file LightComponent.cpp.
Referenced by mnd::InspectLight().
|
inherited |
Definition at line 12 of file Component.cpp.
References mnd::Component::m_owner.
Referenced by mnd::MeshComponent::Update(), and mnd::SkinnedMeshComponent::Update().
|
pure virtualinherited |
|
virtualinherited |
Reimplemented in mnd::PhysicsComponent, and mnd::PlayerControllerComponent.
Definition at line 10 of file Component.cpp.
Referenced by mnd::GameObject::AddComponent().
|
overridevirtual |
Reimplemented from mnd::Component.
Definition at line 12 of file LightComponent.cpp.
References SetColor().
| void mnd::LightComponent::SetColor | ( | const vec3 & | color | ) |
Set the light's emission colour.
| color | Linear RGB values in [0, 1] (HDR values > 1 are allowed). |
Definition at line 7 of file LightComponent.cpp.
Referenced by mnd::InspectLight(), and LoadProperties().
|
inlinestaticinherited |
Definition at line 50 of file Component.h.
|
overridevirtual |
No per-frame computation needed; position is queried from owner on demand.
Implements mnd::Component.
Definition at line 5 of file LightComponent.cpp.
|
protectedinherited |
Definition at line 57 of file Component.h.
Referenced by mnd::GameObject::AddComponent(), mnd::HealthComponent::ApplyDamage(), mnd::Component::GetOwner(), mnd::CameraComponent::GetViewMatrix(), mnd::PhysicsComponent::Init(), mnd::PlayerControllerComponent::Init(), mnd::PlayerControllerComponent::Update(), mnd::AudioComponent::Update(), mnd::AudioListenerComponent::Update(), and mnd::PhysicsComponent::Update().