46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
#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"
|
|
|
|
#include "../buffer/HydraLightBufferManager.h"
|
|
#include "../buffer/HydraLightBuffer.h"
|
|
|
|
|
|
|
|
|
|
void HydraDirectionalLightActor::InitialiseComponents()
|
|
{
|
|
HydraLightComponent light_comp = {};
|
|
HydraECS *ecs = GetEngine()->ECS();
|
|
|
|
// HydraLightBuffer light = {};
|
|
// light.light_colour = glm::vec3(1,1,1);
|
|
// light.light_direction = glm::vec3(0,0,0);
|
|
// light.light_intensity = 1;
|
|
// light.light_type = static_cast<uint32_t>(HYDRA_LIGHT_TYPE::HYDRA_LIGHT_DIRECTIONAL);
|
|
|
|
//light_comp.light_id = GetEngine()->LightBufferManager()->CreateLight(light);
|
|
|
|
light_comp.light_colour = glm::vec4(1,1,1,1);
|
|
light_comp.light_intensity = 100.0f;
|
|
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);
|
|
|
|
HydraPositionComponent position_component;
|
|
ecs->AddComponent<HydraPositionComponent>(GetID(), position_component);
|
|
}
|
|
|
|
void HydraDirectionalLightActor::Destroy()
|
|
{
|
|
|
|
}
|