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:
parent
9d0c950bb0
commit
bc406c8bf0
@ -658,10 +658,18 @@ void CompositeViewer::eventTraversal()
|
||||
{
|
||||
setCameraWithFocus(camera);
|
||||
|
||||
const osg::GraphicsContext::Traits* traits = gw ? gw->getTraits() : 0;
|
||||
if (traits)
|
||||
// If this camera is not a slave camera
|
||||
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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user