Further work on improving stereo support in the OSG.
Renamed the osg::VisualsSettings to osg::DisplaySettings, and osgUtil::VisualsRequirementsVisitor to osgUtil::DisplayRequirementsVisitor. Added support for OSG_SCREEN_HEIGHT into osg::DisplaySettings, and added a DisplaySettings* to the constructors of osg::SceneView and osg::Camera.
This commit is contained in:
@@ -266,38 +266,38 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
|
||||
addMouseEvent(ea);
|
||||
us.requestContinuousUpdate(true);
|
||||
if (calcMovement()) us.requestRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
case(GUIEventAdapter::RELEASE):
|
||||
{
|
||||
|
||||
addMouseEvent(ea);
|
||||
us.requestContinuousUpdate(true);
|
||||
if (calcMovement()) us.requestRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
case(GUIEventAdapter::DRAG):
|
||||
{
|
||||
|
||||
addMouseEvent(ea);
|
||||
us.requestContinuousUpdate(true);
|
||||
if (calcMovement()) us.requestRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
case(GUIEventAdapter::MOVE):
|
||||
{
|
||||
|
||||
addMouseEvent(ea);
|
||||
us.requestContinuousUpdate(true);
|
||||
if (calcMovement()) us.requestRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
case(GUIEventAdapter::KEYBOARD):
|
||||
{
|
||||
if (ea.getKey()==' ')
|
||||
{
|
||||
flushMouseEventStack();
|
||||
@@ -316,18 +316,33 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
|
||||
_speedMode = USE_MOUSE_BUTTONS_FOR_SPEED;
|
||||
return true;
|
||||
}
|
||||
|
||||
else if (ea.getKey()=='+')
|
||||
{
|
||||
_camera->setFusionDistanceRatio(_camera->getFusionDistanceRatio()*1.25f);
|
||||
return true;
|
||||
}
|
||||
else if (ea.getKey()=='-')
|
||||
{
|
||||
_camera->setFusionDistanceRatio(_camera->getFusionDistanceRatio()/1.25f);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
case(GUIEventAdapter::FRAME):
|
||||
{
|
||||
addMouseEvent(ea);
|
||||
if (calcMovement()) us.requestRedraw();
|
||||
return true;
|
||||
}
|
||||
|
||||
case(GUIEventAdapter::RESIZE):
|
||||
{
|
||||
init(ea,us);
|
||||
us.requestRedraw();
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -350,11 +365,11 @@ void DriveManipulator::addMouseEvent(const GUIEventAdapter& ea)
|
||||
|
||||
bool DriveManipulator::calcMovement()
|
||||
{
|
||||
_camera->setFusionDistanceMode(osg::Camera::PROPORTIONAL_TO_SCREEN_DISTANCE);
|
||||
|
||||
// return if less then two events have been added.
|
||||
if (_ga_t0.get()==NULL || _ga_t1.get()==NULL) return false;
|
||||
|
||||
_camera->setFusionDistanceFunction(osg::Camera::PROPORTIONAL_TO_SCREEN_DISTANCE,1.0f);
|
||||
|
||||
float dt = _ga_t0->time()-_ga_t1->time();
|
||||
|
||||
if (dt<0.0f)
|
||||
|
||||
Reference in New Issue
Block a user