Commit e1b2b853 authored by Jan Möbius's avatar Jan Möbius

Set a minimal scene size of 10

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10160 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7449843f
......@@ -277,6 +277,8 @@ void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _resetTra
ACG::Vec3d bbmin = (ACG::Vec3d) act.bbMin();
ACG::Vec3d bbmax = (ACG::Vec3d) act.bbMax();
if ( ( bbmin[0] > bbmax[0] ) ||
( bbmin[1] > bbmax[1] ) ||
......@@ -288,10 +290,22 @@ void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _resetTra
// Update bounding box to match the scene geometry after recovery
bbmin = ACG::Vec3d(-1.0,-1.0,-1.0);
bbmax = ACG::Vec3d( 1.0, 1.0, 1.0);
} else
setScenePos( ( bbmin + bbmax ) * 0.5,
( bbmax - bbmin ).norm() * 0.5,
_resetTrackBall);
} else {
// For small scenes, we set the scene radius to 10
// otherwise we take the real radius
if ( ( bbmax - bbmin ).max() < 10.0 ) {
setScenePos( ( bbmin + bbmax ) * 0.5,
10.0,
_resetTrackBall);
} else {
setScenePos( ( bbmin + bbmax ) * 0.5,
( bbmax - bbmin ).norm() * 0.5,
_resetTrackBall);
}
}
// remember the new bounding box for the state
glstate_->set_bounding_box(bbmin,bbmax);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment