Makes point and spot lights be correctly culled with zoning like other objects.

This commit is contained in:
Areloch 2016-06-17 00:47:46 -05:00
parent ca4e4fe86d
commit dfb8f4f5e5
5 changed files with 23 additions and 2 deletions

View file

@ -227,6 +227,15 @@ void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLigh
// Cull the lights using the frustum.
getSceneManager()->getContainer()->findObjectList( *frustum, lightMask, &activeLights );
for (U32 i = 0; i < activeLights.size(); ++i)
{
if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
{
activeLights.erase(i);
--i;
}
}
// Store the culling position for sun placement
// later... see setSpecialLight.
mCullPos = frustum->getPosition();