Improved taper ratio computation

This commit is contained in:
Robert Osfield 2007-05-30 17:56:43 +00:00
parent 7b31aeca43
commit 9b1426e47e

View File

@ -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)
{
@ -1444,6 +1446,9 @@ void OverlayNode::traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY(osg::NodeVis
}
}
if (topLeft.x() < min_side) min_side = topLeft.x();
if (topRight.x() > max_side) max_side = topRight.x();
#if 0
osg::notify(osg::NOTICE)<<"a topLeft = "<<topLeft<<std::endl;
osg::notify(osg::NOTICE)<<"a lowerLeft = "<<lowerLeft<<std::endl;