From Paul Martz, "The attached code change causes the flt plugin to leave _sector unset if the
direction normal has a zero length. The net effect is that unidirectional light points with zero length direction vectors are now treated as omnidirectional light points."
This commit is contained in:
parent
3fea25a0a1
commit
1aa0592878
@ -2207,7 +2207,6 @@ void ConvertFromFLT::visitLightPoint(osg::Group& osgParent, LightPointRecord* re
|
||||
{
|
||||
azimAngle = acos( pNormal.y() );
|
||||
if( pNormal.y() > 0.0f ) azimAngle = - azimAngle;
|
||||
}
|
||||
|
||||
float minAzimuth = azimAngle - lobeHorz/2.0f;
|
||||
float maxAzimuth = azimAngle + lobeHorz/2.0f;
|
||||
@ -2215,6 +2214,7 @@ void ConvertFromFLT::visitLightPoint(osg::Group& osgParent, LightPointRecord* re
|
||||
float fadeRange = 0.0f;
|
||||
lp._sector = new osgSim::AzimElevationSector( minAzimuth, maxAzimuth, minElevation, maxElevation, fadeRange);
|
||||
}
|
||||
}
|
||||
|
||||
lpNode->addLightPoint( lp);
|
||||
}
|
||||
@ -2330,7 +2330,6 @@ void ConvertFromFLT::visitLightPointIndex(osg::Group& osgParent, LightPointIndex
|
||||
azimAngle = acos( pNormal.y() );
|
||||
if (pNormal.x() < 0.0f)
|
||||
azimAngle = -azimAngle;
|
||||
}
|
||||
|
||||
float minAzimuth = azimAngle - lobeHorz/2.0f;
|
||||
float maxAzimuth = azimAngle + lobeHorz/2.0f;
|
||||
@ -2338,6 +2337,7 @@ void ConvertFromFLT::visitLightPointIndex(osg::Group& osgParent, LightPointIndex
|
||||
float fadeRange = 0.0f;
|
||||
lp._sector = new osgSim::AzimElevationSector( minAzimuth, maxAzimuth, minElevation, maxElevation, fadeRange);
|
||||
}
|
||||
}
|
||||
|
||||
lpNode->addLightPoint(lp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user