Added getCameraManipulator(unsigned int) method.

This commit is contained in:
Robert Osfield 2003-03-19 21:14:50 +00:00
parent 6fc7f82a31
commit 21a74223e6
2 changed files with 20 additions and 0 deletions

View File

@ -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...

View File

@ -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){