Fixed bug in the flight and drive manipulators where they would uncontrollably
shrink down to a tiny window size when one rezized the window.
This commit is contained in:
@@ -257,8 +257,11 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us)
|
||||
}
|
||||
}
|
||||
|
||||
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
|
||||
|
||||
if (ea.getEventType()!=GUIEventAdapter::RESIZE)
|
||||
{
|
||||
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
|
||||
}
|
||||
|
||||
computeLocalDataFromCamera();
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,10 @@ void FlightManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us)
|
||||
|
||||
_velocity = 0.0f;
|
||||
|
||||
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
|
||||
if (ea.getEventType()!=GUIEventAdapter::RESIZE)
|
||||
{
|
||||
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2,(ea.getYmin()+ea.getYmax())/2);
|
||||
}
|
||||
|
||||
computeLocalDataFromCamera();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ void KeySwitchCameraManipulator::addCameraManipulator(int key, std::string name,
|
||||
_manips[key]=std::make_pair(name,osg::ref_ptr<CameraManipulator>(cm));
|
||||
if(!_current.valid()){
|
||||
_current=cm;
|
||||
_current->setNode(_current->getNode());
|
||||
_current->setCamera(_current->getCamera());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,13 +41,3 @@ bool KeySwitchCameraManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt
|
||||
|
||||
return _current->handle(ea,aa);
|
||||
}
|
||||
|
||||
// void KeySwitchCameraManipulator::addCallback(Callback* c)
|
||||
// {
|
||||
// _cameraManipChangeCallbacks.addCallback(c);
|
||||
// }
|
||||
//
|
||||
// void KeySwitchCameraManipulator::removeCallback(Callback* c)
|
||||
// {
|
||||
// _cameraManipChangeCallbacks.removeCallback(c);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user