Commit 6621cdd3 authored by Jan Möbius's avatar Jan Möbius

Fixed setScenepos ... Mike produced that bug

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7087 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6fe33b43
......@@ -398,20 +398,25 @@ void glViewer::updateProjectionMatrix()
void glViewer::setScenePos(const ACG::Vec3d& _center, double _radius, const bool _setCenter)
{
if(_setCenter) {
scene_center_ = trackball_center_ = _center;
}
if(_setCenter) {
scene_center_ = trackball_center_ = _center;
}
scene_radius_ = trackball_radius_ = _radius;
scene_radius_ = trackball_radius_ = _radius;
// orthoWidth_ = 2.0 * scene_radius_;
near_ = 0.001 * scene_radius_;
far_ = 10.0 * scene_radius_;
ACG::Vec3d c = glstate_->modelview().transform_point(scene_center_);
updateProjectionMatrix();
updateGL();
emit viewChanged();
// Set far plane
far_ = std::max(0.0002f * scene_radius_, -(c[2] - scene_radius_));
// Set near plane
near_ = std::max(0.0001f * scene_radius_, -(c[2] + scene_radius_));
updateProjectionMatrix();
updateGL();
emit viewChanged();
}
//-----------------------------------------------------------------------------
......
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