Added missing check against handling invalid bounding sphere's

This commit is contained in:
Robert Osfield 2008-05-08 17:02:08 +00:00
parent 59653bcc08
commit f733bf17e9

View File

@ -93,6 +93,8 @@ void BoundingSphere::expandRadiusBy(const Vec3d& v)
void BoundingSphere::expandBy(const BoundingSphere& sh)
{
// ignore operation if incomming BoundingSphere is invalid.
if (!sh.valid()) return;
// This sphere is not set so use the inbound sphere
if (!valid())
@ -102,7 +104,7 @@ void BoundingSphere::expandBy(const BoundingSphere& sh)
return;
}
// Calculate d == The distance between the sphere centers
double d = ( _center - sh.center() ).length();