Commit 00dd9461 authored by Mike Kremer's avatar Mike Kremer
Browse files

Seperate trackball setting from scene center setting

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7149 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e72a7865
......@@ -256,7 +256,7 @@ void glViewer::swapBuffers() {
//-----------------------------------------------------------------------------
void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _setCenter)
void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _resetTrackBall)
{
sceneGraphRoot_ = _root;
......@@ -272,11 +272,11 @@ void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _setCente
if ( ( bbmin[0] > bbmax[0] ) ||
( bbmin[1] > bbmax[1] ) ||
( bbmin[2] > bbmax[2] ) )
setScenePos( ACG::Vec3d( 0.0,0.0,0.0 ) , 1.0, _setCenter );
setScenePos( ACG::Vec3d( 0.0,0.0,0.0 ) , 1.0, _resetTrackBall );
else
setScenePos( ( bbmin + bbmax ) * 0.5,
( bbmax - bbmin ).norm() * 0.5,
_setCenter);
_resetTrackBall);
}
updateGL();
......@@ -393,12 +393,14 @@ void glViewer::updateProjectionMatrix()
//-----------------------------------------------------------------------------
void glViewer::setScenePos(const ACG::Vec3d& _center, double _radius, const bool _setCenter)
void glViewer::setScenePos(const ACG::Vec3d& _center, double _radius, const bool _resetTrackBall)
{
if(_setCenter) {
scene_center_ = trackball_center_ = _center;
if(_resetTrackBall) {
trackball_center_ = _center;
}
scene_center_ = _center;
scene_radius_ = trackball_radius_ = _radius;
ACG::Vec3d c = glstate_->modelview().transform_point(scene_center_);
......
......@@ -177,12 +177,11 @@ public:
/** Set scene graph.
Sets the scene graph to the the graph rooted at \c _root.
The available draw modes in the scene graph will be collected
and the popup menu will be updated.<br>
Recomputes Scene center and resets the trackball center if specified.
The \c sceneGraphToched() signal will be emitted (even if
\c _root does not actually change).
*/
void sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _setCenter = false);
void sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _resetTrackBall = false);
/// projection mode
......@@ -211,7 +210,7 @@ public:
used as fixpoint for rotations and to set the eye point far
enough from the scene so that the whole scene is visible.
*/
void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _setCenter = false );
void setScenePos( const ACG::Vec3d& _center, double _radius, const bool _resetTrackBall = false );
/**
* Set new center point of scene
......
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