diff --git a/include/osgGA/KeySwitchCameraManipulator b/include/osgGA/KeySwitchCameraManipulator index 804065074..123b22298 100644 --- a/include/osgGA/KeySwitchCameraManipulator +++ b/include/osgGA/KeySwitchCameraManipulator @@ -56,6 +56,12 @@ public: const CameraManipulator* getCurrentCameraManipulator() const { return _current.get(); } + + CameraManipulator* getCameraManipulator(unsigned int num); + + const CameraManipulator* getCameraManipulator(unsigned int num) const; + + // Overrides from CameraManipulator... diff --git a/src/osgGA/KeySwitchCameraManipulator.cpp b/src/osgGA/KeySwitchCameraManipulator.cpp index f890e0b47..69ca9c4c9 100644 --- a/src/osgGA/KeySwitchCameraManipulator.cpp +++ b/src/osgGA/KeySwitchCameraManipulator.cpp @@ -42,6 +42,20 @@ void KeySwitchCameraManipulator::selectCameraManipulator(unsigned int num) } } +CameraManipulator* KeySwitchCameraManipulator::getCameraManipulator(unsigned int num) +{ + KeyManipMap::iterator itr = _manips.find(num); + if (itr!=_manips.end()) return itr->second.second.get(); + else return 0; +} + +const CameraManipulator* KeySwitchCameraManipulator::getCameraManipulator(unsigned int num) const +{ + KeyManipMap::const_iterator itr = _manips.find(num); + if (itr!=_manips.end()) return itr->second.second.get(); + else return 0; +} + bool KeySwitchCameraManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa) { if(ea.getEventType()==GUIEventAdapter::KEYDOWN){