Fixed ABSOLUTE_RF slave camera resize policy, merged from svn trunk using:

http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/
This commit is contained in:
Robert Osfield
2009-05-07 14:58:22 +00:00
parent 4ae4b9fdf5
commit 67ef3fd2c5

View File

@@ -818,14 +818,26 @@ void GraphicsContext::resizedImplementation(int x, int y, int width, int height)
{
osg::View* view = camera->getView();
osg::View::Slave* slave = view ? view->findSlaveForCamera(camera) : 0;
if (slave && camera->getReferenceFrame()==osg::Transform::RELATIVE_RF)
if (slave)
{
switch(view->getCamera()->getProjectionResizePolicy())
if (camera->getReferenceFrame()==osg::Transform::RELATIVE_RF)
{
case(osg::Camera::HORIZONTAL): slave->_projectionOffset *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break;
case(osg::Camera::VERTICAL): slave->_projectionOffset *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break;
default: break;
switch(view->getCamera()->getProjectionResizePolicy())
{
case(osg::Camera::HORIZONTAL): slave->_projectionOffset *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break;
case(osg::Camera::VERTICAL): slave->_projectionOffset *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break;
default: break;
}
}
else
{
switch(camera->getProjectionResizePolicy())
{
case(osg::Camera::HORIZONTAL): camera->getProjectionMatrix() *= osg::Matrix::scale(1.0/aspectRatioChange,1.0,1.0); break;
case(osg::Camera::VERTICAL): camera->getProjectionMatrix() *= osg::Matrix::scale(1.0, aspectRatioChange,1.0); break;
default: break;
}
}
}
else
@@ -839,10 +851,10 @@ void GraphicsContext::resizedImplementation(int x, int y, int width, int height)
}
}
}
}
}
_traits->x = x;
_traits->y = y;
_traits->width = width;