Show
Ignore:
Timestamp:
12/05/05 11:08:52 (8 years ago)
Author:
robert
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgkeyboardmouse/osgkeyboardmouse.cpp

    r4805 r4880  
    9898        { 
    9999            const osg::BoundingSphere& bs = scene->getBound(); 
    100             _trackBall->reset(); 
    101             _trackBall->setOrientation( Producer::Trackball::Z_UP ); 
    102             _trackBall->setDistance(bs.radius()*2.0f); 
    103             _trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z()); 
     100            if (bs.valid()) 
     101            { 
     102                _trackBall->reset(); 
     103                _trackBall->setOrientation( Producer::Trackball::Z_UP ); 
     104                _trackBall->setDistance(bs.radius()*2.0f); 
     105                _trackBall->translate(-bs.center().x(),-bs.center().y(),-bs.center().z()); 
     106            } 
    104107        } 
    105108    }