2026-07-18 18:39:17 +01:00
|
|
|
#include "HydraSpotLightActor.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-08-04 18:32:37 +01:00
|
|
|
#include "../ecs/components/HydraDirectionalShadowSourceComponent.h"
|
2026-07-18 18:39:17 +01:00
|
|
|
|
|
|
|
|
#include "../buffer/HydraLightBufferManager.h"
|
|
|
|
|
#include "../buffer/HydraLightBuffer.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void HydraSpotLightActor::InitialiseComponents()
|
|
|
|
|
{
|
|
|
|
|
HydraLightComponent light_comp = {};
|
|
|
|
|
HydraECS *ecs = GetEngine()->ECS();
|
|
|
|
|
|
|
|
|
|
light_comp.diffuse = glm::vec4(1,1,1,1);
|
2026-07-24 19:03:34 +01:00
|
|
|
light_comp.intensity = 1000.0f;
|
2026-07-18 18:39:17 +01:00
|
|
|
light_comp.light_type = static_cast<uint32_t>(HYDRA_LIGHT_TYPE::HYDRA_LIGHT_SPOT);
|
2026-07-24 19:03:34 +01:00
|
|
|
light_comp.cutoff = glm::cos(glm::radians(10.0f));
|
|
|
|
|
light_comp.cutoff_outer = glm::cos(glm::radians(25.0f));
|
2026-07-18 18:39:17 +01:00
|
|
|
light_comp.entity_id = GetID();
|
|
|
|
|
|
|
|
|
|
ecs->AddComponent<HydraLightComponent>(GetID(), light_comp);
|
|
|
|
|
|
|
|
|
|
HydraPositionComponent position_component;
|
|
|
|
|
ecs->AddComponent<HydraPositionComponent>(GetID(), position_component);
|
2026-08-04 17:39:07 +01:00
|
|
|
|
2026-08-04 18:32:37 +01:00
|
|
|
HydraDirectionalShadowSourceComponent shadow_component = {};
|
|
|
|
|
ecs->AddComponent<HydraDirectionalShadowSourceComponent>(GetID(), shadow_component);
|
2026-07-18 18:39:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HydraSpotLightActor::Destroy()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|