From 24a8b2acd76a6eace68e095f79efc93a45b83098 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 8 Jun 2009 11:12:34 +0000 Subject: [PATCH] From Lionel Lagarde, "this correction makes the intensity interpolated in the correct direction when the angle is between _cosFadeAngle and _cosAngle." --- src/osgSim/Sector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgSim/Sector.cpp b/src/osgSim/Sector.cpp index 580619158..0088dfc5b 100644 --- a/src/osgSim/Sector.cpp +++ b/src/osgSim/Sector.cpp @@ -323,7 +323,7 @@ float DirectionalSector::operator() (const osg::Vec3& eyeLocal) const if ( EPyz[0] < _cosVertAngle ) { // In the fade range //fprintf(stderr, " >> inside el fade range\n") ; - elev_intensity = (_cosVertAngle-EPyz[0])/(_cosVertAngle-_cosVertFadeAngle) ; + elev_intensity = (EPyz[0]-_cosVertFadeAngle)/(_cosVertAngle-_cosVertFadeAngle) ; } else { // Fully in elevation range elev_intensity = 1.0 ; @@ -349,7 +349,7 @@ float DirectionalSector::operator() (const osg::Vec3& eyeLocal) const if ( EPxy[1] < _cosHorizAngle ) { // In fade range //fprintf(stderr, " >> inside az fade range\n") ; - azim_intensity = (_cosHorizAngle-EPxy[1])/(_cosHorizAngle-_cosHorizFadeAngle) ; + azim_intensity = (EPxy[1]-_cosHorizFadeAngle)/(_cosHorizAngle-_cosHorizFadeAngle) ; } else { // Fully in azimuth range //fprintf(stderr, " >> fully inside az range\n") ;