Fixed endless loop in the eclipse finder. Bodies with intersecting bounding spheres

were considered to be in eclipse. If they happened to be fixed relative to each other,
the loop to find the eclipse duration would never terminate. An extra line of code
was added to reject eclipses between intersecting bodies.
ver1_5_1
Chris Laurel 2008-01-24 00:50:29 +00:00
parent ced10787e8
commit 211ae85b88
1 changed files with 4 additions and 1 deletions

View File

@ -92,7 +92,10 @@ bool EclipseFinder::testEclipse(const Body& receiver, const Body& caster,
Ray3d(posCaster, posCaster - Point3d(0, 0, 0)));
if (dist < R)
{
return true;
// Ignore "eclipses" where the caster and receiver have
// intersecting bounding spheres.
if (distToCaster > caster.getRadius())
return true;
}
}