Commit 2528c76c authored by Jan Möbius's avatar Jan Möbius

Fixed bug in cursor stereo depth computation. closes #1386

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16184 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 33bef1a7
......@@ -2130,12 +2130,24 @@ void glViewer::updateCursorPosition (QPointF _scenePos)
ACG::Vec3d tmp;
unsigned int nodeIdx = 0;
unsigned int targetIdx = 0;
// ignore cursor if we are outside of our window
if (!mapRectToScene(boundingRect ()).intersects (properties_.cursorPainter()->cursorBoundingBox().translated(_scenePos)))
{
properties_.cursorPositionValid( false );
}
// only do real pick in stereo mode
else if ( properties_.stereo() && OpenFlipperSettings().value("Core/Gui/glViewer/stereoMousePick",true).toBool() &&
pick (ACG::SceneGraph::PICK_ANYTHING, _scenePos.toPoint(), nodeIdx, targetIdx, &tmp))
{
// the point we get back will contain the view transformation and we have to revert it
properties_.cursorPoint3D(glstate_->modelview().transform_point(tmp));
properties_.cursorPositionValid(true);
}
// only do real pick in stereo mode
else
{
glstate_->push_modelview_matrix ();
......
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