Added getCameraByName method to viewer

This commit is contained in:
Don BURNS 2005-03-21 00:33:37 +00:00
parent 5d10547ac5
commit 8eb0e8ca88

View File

@ -913,6 +913,21 @@ bool Viewer::selectCameraManipulatorByName( const std::string &name )
return true; return true;
} }
osgGA::MatrixManipulator *Viewer::getCameraManipulatorByName( const std::string &name )
{
osgGA::KeySwitchMatrixManipulator *ksm = getKeySwitchMatrixManipulator();
osgGA::KeySwitchMatrixManipulator::KeyManipMap &kmmap = ksm->getKeyManipMap();
osgGA::KeySwitchMatrixManipulator::KeyManipMap::iterator p;
for( p = kmmap.begin(); p != kmmap.end(); p++ )
{
osgGA::KeySwitchMatrixManipulator::NamedManipulator nm = (*p).second;
if( nm.first == name )
return nm.second.get();
}
return 0L;
}
void Viewer::requestRedraw() void Viewer::requestRedraw()
{ {