Spot started

This commit is contained in:
Confideo-IOM
2026-08-04 22:40:48 +01:00
parent f51b435a9d
commit 6d7d7571b5
48 changed files with 1086 additions and 1222 deletions
+23 -7
View File
@@ -21,6 +21,8 @@
#include "../ecs/systems/HydraMaterialSystem.h"
#include "../ecs/systems/HydraLightSystem.h"
#include "../ecs/systems/HydraDirectionalShadowSourceSystem.h"
#include "../ecs/systems/HydraSpotShadowSourceSystem.h"
#include "../ecs/components/HydraPositionComponent.h"
#include "../ecs/components/HydraMeshComponent.h"
#include "../ecs/components/HydraRenderableComponent.h"
@@ -28,6 +30,7 @@
#include "../ecs/components/HydraMaterialComponent.h"
#include "../ecs/components/HydraLightComponent.h"
#include "../ecs/components/HydraDirectionalShadowSourceComponent.h"
#include "../ecs/components/HydraSpotShadowSourceComponent.h"
#include "../camera/HydraCamera.h"
@@ -216,20 +219,23 @@ void HydraEngine::_InitialiseSystems()
m_ecs->RegisterComponentType<HydraMaterialComponent>();
m_ecs->RegisterComponentType<HydraLightComponent>();
m_ecs->RegisterComponentType<HydraDirectionalShadowSourceComponent>();
m_ecs->RegisterComponentType<HydraSpotShadowSourceComponent>();
m_mesh_system = m_ecs->RegisterSystem<HydraMeshSystem>();
m_transform_system = m_ecs->RegisterSystem<HydraTransformSystem>();
m_render_system = m_ecs->RegisterSystem<HydraRenderSystem>();
m_material_system = m_ecs->RegisterSystem<HydraMaterialSystem>();
m_light_system = m_ecs->RegisterSystem<HydraLightSystem>();
m_shadow_system = m_ecs->RegisterSystem<HydraDirectionalShadowSourceSystem>();
m_directional_shadow_system = m_ecs->RegisterSystem<HydraDirectionalShadowSourceSystem>();
m_spot_shadow_system = m_ecs->RegisterSystem<HydraSpotShadowSourceSystem>();
HydraSignature mesh_sig;
HydraSignature trans_sig;
HydraSignature render_sig;
HydraSignature material_sig;
HydraSignature light_sig;
HydraSignature shadow_sig;
HydraSignature directional_shadow_sig;
HydraSignature spot_shadow_sig;
mesh_sig.set(m_ecs->GetComponentType<HydraMeshComponent>(),true);
trans_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(),true);
@@ -239,16 +245,21 @@ void HydraEngine::_InitialiseSystems()
light_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
light_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
shadow_sig.set(m_ecs->GetComponentType<HydraDirectionalShadowSourceComponent>(), true);
directional_shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
directional_shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
directional_shadow_sig.set(m_ecs->GetComponentType<HydraDirectionalShadowSourceComponent>(), true);
spot_shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
spot_shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
spot_shadow_sig.set(m_ecs->GetComponentType<HydraSpotShadowSourceComponent>(), true);
m_ecs->SetSystemSignature<HydraMeshSystem>(mesh_sig);
m_ecs->SetSystemSignature<HydraTransformSystem>(trans_sig);
m_ecs->SetSystemSignature<HydraRenderSystem>(render_sig);
m_ecs->SetSystemSignature<HydraMaterialSystem>(material_sig);
m_ecs->SetSystemSignature<HydraLightSystem>(light_sig);
m_ecs->SetSystemSignature<HydraDirectionalShadowSourceSystem>(shadow_sig);
m_ecs->SetSystemSignature<HydraDirectionalShadowSourceSystem>(directional_shadow_sig);
m_ecs->SetSystemSignature<HydraSpotShadowSourceSystem>(spot_shadow_sig);
}
@@ -276,9 +287,14 @@ void HydraEngine::_InitialiseSystems()
HydraID update_shadow_id = m_task_scheduler->CreateTask<HydraUpdateSystemTask>(HydraThreadAffinity::General);
HydraUpdateSystemTask* update_shadow_task = static_cast<HydraUpdateSystemTask*>(m_task_scheduler->GetTask(update_shadow_id));
update_shadow_task->Initialise(m_delta_t, m_shadow_system);
update_shadow_task->Initialise(m_delta_t, m_directional_shadow_system);
m_task_scheduler->WaitForTask(update_shadow_id);
HydraID update_spot_shadow_id = m_task_scheduler->CreateTask<HydraUpdateSystemTask>(HydraThreadAffinity::General);
HydraUpdateSystemTask* update_spot_shadow_task = static_cast<HydraUpdateSystemTask*>(m_task_scheduler->GetTask(update_spot_shadow_id));
update_spot_shadow_task->Initialise(m_delta_t, m_spot_shadow_system);
m_task_scheduler->WaitForTask(update_spot_shadow_id);
}
void HydraEngine::_GameLoop()