From Geoff Michel, Fix to prevent Producer::Trackball being set up with a negative
radius.
This commit is contained in:
parent
c45ead4c65
commit
edf4598838
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user