Pointlights are now using the pointlight component and the Light renderqueue to draw.

This commit is contained in:
Tleety
2016-01-08 14:12:09 +01:00
parent 25a99a04c5
commit dab4ba2164
5 changed files with 67 additions and 19 deletions
@@ -111,6 +111,34 @@ void RenderQueueFactory::FillModels(World* world, RenderQueue* renderQueue)
void RenderQueueFactory::FillLights(World* world, RenderQueue* renderQueue)
{
auto pointLights = world->GetComponents("PointLight");
if(pointLights == nullptr) {
return;
}
for(auto& pointlightC : *pointLights) {
bool visible = pointlightC["Visible"];
if(!visible) {
continue;
}
auto transformC = world->GetComponent(pointlightC.EntityID, "Transform");
if(&transformC == nullptr) {
return;
}
glm::vec4 color = pointlightC["Color"];
float radius = (double)pointlightC["Radius"];
float intensity = (double)pointlightC["Intensity"];
float falloff = (double)pointlightC["Falloff"];
PointLightJob job;
job.Position = transformC["Position"];
job.Color = color;
job.Radius = radius;
job.Intensity = intensity;
job.Falloff = falloff;
renderQueue->Add(job);
}
}