From 70c78264dc16fb33874b84eb3515b8c8c3a0c5f3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 7 Nov 2013 12:37:10 +0000 Subject: [PATCH] Changed the LineSegmentIntersector to RayIntersector to provide more reliable intersections with flat meshes. --- src/osgViewer/Viewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index cb9c12b56..cb66e3e3c 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include @@ -714,7 +716,7 @@ void Viewer::generateSlavePointerData(osg::Camera* camera, osgGA::GUIEventAdapte { // Are their any RTT Camera's that this Camera depends upon for textures? - osg::ref_ptr ray = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, x,y); + osg::ref_ptr ray = new osgUtil::RayIntersector(osgUtil::Intersector::WINDOW, x,y); osgUtil::IntersectionVisitor iv(ray.get()); camera->accept(iv); if (ray->containsIntersections())