Completed changes to osgManipulator to make it more flexible w.r.t viewer usage, and

ported osgmanipulator example across of osgViewer
This commit is contained in:
Robert Osfield
2007-02-26 13:01:17 +00:00
parent 42689e83ef
commit 7f8f4e331a
15 changed files with 270 additions and 202 deletions

View File

@@ -301,6 +301,23 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us)
bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
{
switch(ea.getEventType())
{
case(GUIEventAdapter::FRAME):
addMouseEvent(ea);
if (calcMovement()) us.requestRedraw();
return false;
case(GUIEventAdapter::RESIZE):
init(ea,us);
us.requestRedraw();
return true;
default:
break;
}
if (ea.getHandled()) return false;
switch(ea.getEventType())
{
case(GUIEventAdapter::PUSH):
@@ -399,22 +416,6 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
return false;
}
_pitchDownKeyPressed = false;
case(GUIEventAdapter::FRAME):
{
addMouseEvent(ea);
if (calcMovement()) us.requestRedraw();
return false;
}
case(GUIEventAdapter::RESIZE):
{
init(ea,us);
us.requestRedraw();
return true;
}
default:
return false;
}