From f5f3d18b8e7e4842cd4be02729ffd51eb24b73a8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 30 Nov 2015 17:19:27 +0100 Subject: [PATCH] Add comment --- apps/openmw/mwrender/characterpreview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index e2ff08b6b..a6f68b5d4 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -271,7 +271,10 @@ namespace MWRender { float projX = (posX / mCamera->getViewport()->width()) * 2 - 1.f; float projY = (posY / mCamera->getViewport()->height()) * 2 - 1.f; - // With Intersector::WINDOW, the intersection ratios are slightly inaccurate. TODO: investigate + // With Intersector::WINDOW, the intersection ratios are slightly inaccurate. Seems to be a + // precision issue - compiling with OSG_USE_FLOAT_MATRIX=0, Intersector::WINDOW works ok. + // Using Intersector::PROJECTION results in better precision because the start/end points and the model matrices + // don't go through as many transformations. osg::ref_ptr intersector (new osgUtil::LineSegmentIntersector(osgUtil::Intersector::PROJECTION, projX, projY)); intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::LIMIT_NEAREST);