|
|
@ -352,13 +352,13 @@ public:
|
|
|
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
|
|
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(nv);
|
|
|
|
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(nv);
|
|
|
|
osg::RefMatrix* projectionMatrix = new osg::RefMatrix(*cv->getProjectionMatrix());
|
|
|
|
|
|
|
|
float fov, aspect, zNear, zFar;
|
|
|
|
float fov, aspect, zNear, zFar;
|
|
|
|
if (projectionMatrix->getPerspective(fov, aspect, zNear, zFar))
|
|
|
|
if (cv->getProjectionMatrix()->getPerspective(fov, aspect, zNear, zFar))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fov = mFov;
|
|
|
|
fov = mFov;
|
|
|
|
projectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
|
|
|
osg::RefMatrix* newProjectionMatrix = new osg::RefMatrix(*cv->getProjectionMatrix());
|
|
|
|
cv->pushProjectionMatrix(projectionMatrix);
|
|
|
|
newProjectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
|
|
|
|
|
|
|
cv->pushProjectionMatrix(newProjectionMatrix);
|
|
|
|
traverse(node, nv);
|
|
|
|
traverse(node, nv);
|
|
|
|
cv->popProjectionMatrix();
|
|
|
|
cv->popProjectionMatrix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|