From 9b1426e47ed1795d00fa55c68449abcd8c658503 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 30 May 2007 17:56:43 +0000 Subject: [PATCH] Improved taper ratio computation --- src/osgSim/OverlayNode.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/osgSim/OverlayNode.cpp b/src/osgSim/OverlayNode.cpp index 953d45d33..f51712ffe 100644 --- a/src/osgSim/OverlayNode.cpp +++ b/src/osgSim/OverlayNode.cpp @@ -1410,7 +1410,8 @@ void OverlayNode::traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY(osg::NodeVis osg::Vec2d v_max = va + (vb-va) * ( (max_up - va.y())/(vb.y()-va.y()) ); double mid_va_side = (v_max.x() + v_min.x())*0.5; - if (v_min.x() < mid_side && + if (v_min.x() > v_max.x() && + v_min.x() < mid_side && v_max.x() < mid_side && mid_va_side > min_side) { @@ -1427,7 +1428,8 @@ void OverlayNode::traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY(osg::NodeVis osg::Vec2d v_max = va + (vb-va) * ( (max_up - va.y())/(vb.y()-va.y()) ); double mid_va_side = (v_max.x() + v_min.x())*0.5; - if (v_min.x() > mid_side && + if (v_min.x() < v_max.x() && + v_min.x() > mid_side && v_max.x() > mid_side && mid_va_side < max_side) { @@ -1442,7 +1444,10 @@ void OverlayNode::traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY(osg::NodeVis // osg::notify(osg::NOTICE)<<"Crossing va="<