2023-10-26 18:37:29 +02:00
|
|
|
#include "LightGather.h"
|
|
|
|
|
|
|
|
|
|
using namespace Seele;
|
|
|
|
|
using namespace Seele::System;
|
|
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
LightGather::LightGather(PScene scene) : SystemBase(scene), lightEnv(scene->getLightEnvironment()) {}
|
2023-10-26 18:37:29 +02:00
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
LightGather::~LightGather() {}
|
2023-10-26 18:37:29 +02:00
|
|
|
|
2024-06-09 12:20:04 +02:00
|
|
|
void LightGather::update() {
|
2023-11-30 11:51:53 +01:00
|
|
|
lightEnv->reset();
|
2024-06-09 12:20:04 +02:00
|
|
|
scene->view<Component::PointLight>([this](Component::PointLight& pointLight) { lightEnv->addPointLight(pointLight); });
|
|
|
|
|
scene->view<Component::DirectionalLight>([this](Component::DirectionalLight& dirLight) { lightEnv->addDirectionalLight(dirLight); });
|
2023-10-26 18:37:29 +02:00
|
|
|
}
|