Added check so not intialization is down when you select the current camera manipulator
This commit is contained in:
parent
0b778533c8
commit
53405c118a
@ -176,15 +176,19 @@ bool KeySwitchMatrixManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt
|
||||
KeyManipMap::iterator it=_manips.find(ea.getKey());
|
||||
if(it != _manips.end())
|
||||
{
|
||||
OSG_INFO<<"Switching to manipulator: "<<(*it).second.first<<std::endl;
|
||||
if ( !it->second.second->getNode() )
|
||||
CameraManipulator* selectedManipulator = it->second.second.get();
|
||||
if (selectedManipulator!=_current)
|
||||
{
|
||||
it->second.second->setNode(_current->getNode());
|
||||
OSG_INFO<<"Switching to manipulator: "<<it->second.first<<std::endl;
|
||||
if ( !selectedManipulator->getNode() )
|
||||
{
|
||||
selectedManipulator->setNode(_current->getNode());
|
||||
}
|
||||
it->second.second->setByMatrix(_current->getMatrix());
|
||||
it->second.second->init(ea,aa);
|
||||
_current = it->second.second;
|
||||
selectedManipulator->setByMatrix(_current->getMatrix());
|
||||
selectedManipulator->init(ea,aa);
|
||||
|
||||
_current = selectedManipulator;
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user