1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Ensure TerrainDrawables affect the computed near/far planes.

This commit is contained in:
AnyOldName3 2018-01-22 15:52:37 +00:00
parent bf9a1ded63
commit 112ade2a3f

View File

@ -47,6 +47,12 @@ void TerrainDrawable::cull(osgUtil::CullVisitor *cv)
osg::RefMatrix& matrix = *cv->getModelViewMatrix();
if (cv->getComputeNearFarMode() && bb.valid())
{
if (!cv->updateCalculatedNearFar(matrix, *this, false))
return;
}
float depth = bb.valid() ? distance(bb.center(),matrix) : 0.0f;
if (osg::isNaN(depth))
return;