From Roger James, "The light position is incorrectly calculated for shadow casting scenes whose bounding box centre is not the origin. This is a one line fix.

"
This commit is contained in:
Robert Osfield
2008-10-07 15:16:37 +00:00
parent 09e6261e9a
commit ad72dc66ce

View File

@@ -207,7 +207,7 @@ void ShadowTexture::cull(osgUtil::CullVisitor& cv)
lightDir.normalize();
// set the position far away along the light direction
osg::Vec3 position = lightDir * bb.radius() * 20;
osg::Vec3 position = bb.center() + lightDir * bb.radius() * 10.0;
float centerDistance = (position-bb.center()).length();