From Jean-Sebastien Guay, "

The problem can be reproduced by simply changing the osgpick example to
use a CompositeViewer with a single view initialized using
setUpViewAcrossAllScreens(). I have attached a modified osgpick.cpp so
you can test it out quickly (please don't check this file in though :-)
) The eventState is then incorrect and picking does not work. The only
changes are in CompositeViewer.cpp (eventTraversal() method), and fix
the problem for me.
"
This commit is contained in:
Robert Osfield 2008-03-04 17:57:06 +00:00
parent 9d0c950bb0
commit bc406c8bf0

View File

@ -658,10 +658,18 @@ void CompositeViewer::eventTraversal()
{ {
setCameraWithFocus(camera); setCameraWithFocus(camera);
const osg::GraphicsContext::Traits* traits = gw ? gw->getTraits() : 0; // If this camera is not a slave camera
if (traits) if (camera->getView()->getCamera() == camera)
{ {
eventState->setInputRange( 0, 0, traits->width, traits->height); const osg::GraphicsContext::Traits* traits = gw ? gw->getTraits() : 0;
if (traits)
{
eventState->setInputRange( 0, 0, traits->width, traits->height);
}
else
{
eventState->setInputRange(-1.0, -1.0, 1.0, 1.0);
}
} }
else else
{ {