Added osgGA::Device class for integration of both physical and virtual devices.

Added template readFile(..) function to make it more convinient to cast to a specific object type.

Added support for osgGA::Device to osgViewer.

Added sdl plugin to provides very basic joystick osgGA::Device integration.
This commit is contained in:
Robert Osfield
2012-10-23 16:15:03 +00:00
parent f9ad1e5673
commit 1591fe09f3
14 changed files with 491 additions and 2 deletions

View File

@@ -645,6 +645,20 @@ void Viewer::eventTraversal()
}
// get events from user Devices attached to Viewer.
for(Devices::iterator eitr = _eventSources.begin();
eitr != _eventSources.end();
++eitr)
{
osgGA::Device* es = eitr->get();
es->checkEvents();
// open question, will we need to reproject mouse coordinates into current view's coordinate frame as is down for GraphicsWindow provided events?
// for now assume now and just get the events directly without any reprojection.
es->getEventQueue()->takeEvents(events, cutOffTime);
}
// get events from all windows attached to Viewer.
for(Contexts::iterator citr = contexts.begin();
citr != contexts.end();
++citr)