2026-07-17 15:30:29 +01:00
|
|
|
#include "HydraDirectionalLightActor.h"
|
|
|
|
|
#include "../engine/HydraEngine.h"
|
|
|
|
|
#include "../actor/HydraActorManager.h"
|
|
|
|
|
#include "../task/HydraTask.h"
|
|
|
|
|
#include "../ecs/HydraECS.h"
|
|
|
|
|
#include "../ecs/components/HydraPositionComponent.h"
|
|
|
|
|
#include "../ecs/components/HydraMeshComponent.h"
|
|
|
|
|
#include "../ecs/components/HydraRenderableComponent.h"
|
|
|
|
|
#include "../ecs/components/HydraMaterialComponent.h"
|
|
|
|
|
#include "../ecs/components/HydraLightComponent.h"
|
2026-07-25 16:40:34 +01:00
|
|
|
#include "../ecs/components/HydraShadowSourceComponent.h"
|
2026-07-17 15:30:29 +01:00
|
|
|
|
|
|
|
|
#include "../buffer/HydraLightBufferManager.h"
|
|
|
|
|
#include "../buffer/HydraLightBuffer.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void HydraDirectionalLightActor::InitialiseComponents()
|
|
|
|
|
{
|
|
|
|
|
HydraLightComponent light_comp = {};
|
|
|
|
|
HydraECS *ecs = GetEngine()->ECS();
|
2026-07-25 16:40:34 +01:00
|
|
|
|
2026-07-18 18:39:17 +01:00
|
|
|
light_comp.diffuse = glm::vec4(1,1,1,1);
|
2026-08-03 22:34:52 +01:00
|
|
|
light_comp.intensity = 10000.0f;
|
2026-07-17 15:30:29 +01:00
|
|
|
light_comp.light_type = static_cast<uint32_t>(HYDRA_LIGHT_TYPE::HYDRA_LIGHT_DIRECTIONAL);
|
|
|
|
|
light_comp.entity_id = GetID();
|
|
|
|
|
|
|
|
|
|
ecs->AddComponent<HydraLightComponent>(GetID(), light_comp);
|
|
|
|
|
|
2026-07-25 16:40:34 +01:00
|
|
|
HydraPositionComponent position_component = {};
|
2026-07-17 15:30:29 +01:00
|
|
|
ecs->AddComponent<HydraPositionComponent>(GetID(), position_component);
|
2026-07-25 16:40:34 +01:00
|
|
|
|
|
|
|
|
HydraShadowSourceComponent shadow_component = {};
|
|
|
|
|
ecs->AddComponent<HydraShadowSourceComponent>(GetID(), shadow_component);
|
2026-07-17 15:30:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HydraDirectionalLightActor::Destroy()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|