Added setting of the input range of the event state based on the master cameras viewport.
This commit is contained in:
parent
53405c118a
commit
55d03d5b34
@ -798,6 +798,18 @@ void Viewer::eventTraversal()
|
||||
}
|
||||
}
|
||||
|
||||
// pass on the coorindates of the main camera to make sure the frame event is scaled appropriately.
|
||||
if (getCamera()->getViewport())
|
||||
{
|
||||
osg::Viewport* viewport = getCamera()->getViewport();
|
||||
eventState->setInputRange( viewport->x(), viewport->y(), viewport->x() + viewport->width(), viewport->y() + viewport->height());
|
||||
}
|
||||
else
|
||||
{
|
||||
eventState->setInputRange(-1.0, -1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
// create a frame event for the new frame.
|
||||
_eventQueue->frame( getFrameStamp()->getReferenceTime() );
|
||||
|
||||
// OSG_NOTICE<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user