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:
@@ -2217,3 +2217,20 @@ bool View::computeIntersections(float x,float y, const osg::NodePath& nodePath,
|
||||
}
|
||||
|
||||
|
||||
void View::addDevice(osgGA::Device* eventSource)
|
||||
{
|
||||
Devices::iterator itr = std::find( _eventSources.begin(), _eventSources.end(), eventSource );
|
||||
if (itr==_eventSources.end())
|
||||
{
|
||||
_eventSources.push_back(eventSource);
|
||||
}
|
||||
}
|
||||
|
||||
void View::removeDevice(osgGA::Device* eventSource)
|
||||
{
|
||||
Devices::iterator itr = std::find( _eventSources.begin(), _eventSources.end(), eventSource );
|
||||
if (itr!=_eventSources.end())
|
||||
{
|
||||
_eventSources.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user