1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Take the radius of lights into account when sorting

This commit is contained in:
scrawl 2015-07-02 17:19:07 +02:00
parent bf9c62fa42
commit 631cec7304

View file

@ -244,7 +244,7 @@ namespace SceneUtil
bool sortLights (const LightManager::LightSourceTransform* left, const LightManager::LightSourceTransform* right)
{
return left->mViewBound.center().length2() < right->mViewBound.center().length2();
return left->mViewBound.center().length2() - left->mViewBound.radius2()/4.f < right->mViewBound.center().length2() - right->mViewBound.radius2()/4.f;
}
void LightListCallback::operator()(osg::Node *node, osg::NodeVisitor *nv)