From Geoff Michel, Fix to prevent Producer::Trackball being set up with a negative

radius.
This commit is contained in:
Robert Osfield 2005-12-05 10:08:52 +00:00
parent c45ead4c65
commit edf4598838
2 changed files with 14 additions and 8 deletions

View File

@ -97,10 +97,13 @@ public:
if (scene)
{
const osg::BoundingSphere& bs = scene->getBound();
_trackBall->reset();
_trackBall->setOrientation( Producer::Trackball::Z_UP );
_trackBall->setDistance(bs.radius()*2.0f);
_trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z());
if (bs.valid())
{
_trackBall->reset();
_trackBall->setOrientation( Producer::Trackball::Z_UP );
_trackBall->setDistance(bs.radius()*2.0f);
_trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z());
}
}
}

View File

@ -81,10 +81,13 @@ public:
if (scene)
{
const osg::BoundingSphere& bs = scene->getBound();
_trackBall->reset();
_trackBall->setOrientation( Producer::Trackball::Z_UP );
_trackBall->setDistance(bs.radius()*2.0f);
_trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z());
if (bs.valid())
{
_trackBall->reset();
_trackBall->setOrientation( Producer::Trackball::Z_UP );
_trackBall->setDistance(bs.radius()*2.0f);
_trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z());
}
}
}