MCPcopy Create free account
hub / github.com/Illation/ETEngine / OnComponentAdded

Method OnComponentAdded

Engine/source/EtFramework/Systems/LightSystem.cpp:33–41  ·  view source on GitHub ↗

----------------------------------- LightSystem::OnComponentAdded Register lights in the render scene when they are added to the ECS

Source from the content-addressed store, hash-verified

31// Register lights in the render scene when they are added to the ECS
32//
33void LightSystem::OnComponentAdded(EcsController& controller, LightComponent& component, T_EntityId const entity)
34{
35 vec3 const col = component.m_Color * component.m_Brightness;
36
37 component.m_LightId = UnifiedScene::Instance().GetRenderScene().AddLight(col,
38 controller.GetComponent<TransformComponent>(entity).GetNodeId(),
39 component.m_Type == LightComponent::E_Type::Directional,
40 component.m_CastsShadow);
41}
42
43//-------------------------------------
44// LightSystem::OnComponentRemoved

Callers

nothing calls this directly

Calls 2

AddLightMethod · 0.80
GetNodeIdMethod · 0.45

Tested by

no test coverage detected