Added automatic stopping of animation when home() is called

This commit is contained in:
Robert Osfield
2007-06-07 12:23:21 +00:00
parent 32236ab2a4
commit 4b73712f51
4 changed files with 8 additions and 6 deletions

View File

@@ -198,6 +198,7 @@ void DriveManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us)
_pitch = 0.0;
us.requestRedraw();
us.requestContinuousUpdate(false);
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2.0f,(ea.getYmin()+ea.getYmax())/2.0f);
@@ -362,8 +363,6 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
{
flushMouseEventStack();
home(ea,us);
us.requestRedraw();
us.requestContinuousUpdate(false);
return true;
}
else if (ea.getKey()=='q')

View File

@@ -67,7 +67,7 @@ void FlightManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us)
_velocity = 0.0;
us.requestRedraw();
us.requestContinuousUpdate(false);
us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2.0f,(ea.getYmin()+ea.getYmax())/2.0f);
flushMouseEventStack();

View File

@@ -50,12 +50,14 @@ void TrackballManipulator::home(double /*currentTime*/)
{
if (getAutoComputeHomePosition()) computeHomePosition();
computePosition(_homeEye, _homeCenter, _homeUp);
_thrown = false;
}
void TrackballManipulator::home(const GUIEventAdapter& ea ,GUIActionAdapter& us)
{
home(ea.getTime());
us.requestRedraw();
us.requestContinuousUpdate(false);
}
@@ -155,8 +157,6 @@ bool TrackballManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us
flushMouseEventStack();
_thrown = false;
home(ea,us);
us.requestRedraw();
us.requestContinuousUpdate(false);
return true;
}
return false;

View File

@@ -162,9 +162,12 @@ void UFOManipulator::init(const GUIEventAdapter&, GUIActionAdapter&)
_stop();
}
void UFOManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
void UFOManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us)
{
home(ea.getTime());
us.requestRedraw();
us.requestContinuousUpdate(false);
}
void UFOManipulator::home(double)