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
parent
ced10787e8
commit
211ae85b88
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue