From 564077643f8a9b93d9125bf2dde18a6b58348e4f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 7 Apr 2003 14:57:18 +0000 Subject: [PATCH] Set the fusion distance ratio to 1/300.0f to compensate for the coords of the hang gliding database being so small, this allow the scene to be viewed in stereo and still look a convincing size. --- examples/osghangglide/GliderManipulator.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/examples/osghangglide/GliderManipulator.cpp b/examples/osghangglide/GliderManipulator.cpp index ec1b77e35..ffeff66fc 100644 --- a/examples/osghangglide/GliderManipulator.cpp +++ b/examples/osghangglide/GliderManipulator.cpp @@ -75,6 +75,8 @@ void GliderManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) us.requestWarpPointer((ea.getXmin()+ea.getXmax())/2.0f,(ea.getYmin()+ea.getYmax())/2.0f); } + _camera->setFusionDistanceRatio(1/1000.0f); + } @@ -130,16 +132,6 @@ bool GliderManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) us.requestContinuousUpdate(false); 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): @@ -175,7 +167,8 @@ void GliderManipulator::addMouseEvent(const GUIEventAdapter& ea) bool GliderManipulator::calcMovement() { _camera->setFusionDistanceMode(osg::Camera::PROPORTIONAL_TO_SCREEN_DISTANCE); - + _camera->setFusionDistanceRatio(1/300.0f); + // return if less then two events have been added. if (_ga_t0.get()==NULL || _ga_t1.get()==NULL) return false;