diff --git a/vcg/space/sphere3.h b/vcg/space/sphere3.h index 0a325355..782cf3de 100644 --- a/vcg/space/sphere3.h +++ b/vcg/space/sphere3.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.5 2004/09/29 13:55:33 ponchio +Added Distance shpere - point. + Revision 1.4 2004/04/02 09:49:01 ponchio Ehm... a couople of small errors. @@ -84,6 +87,14 @@ template T Distance(const Sphere3 &sphere, return dist; } +template T Distance(const Sphere3 &sphere, + const Sphere3 &s) { + T dist = Distance(s.Center(), sphere.Center()) + - sphere.Radius() - s.Radius(); + if(dist < 0) dist = 0; + return dist; +} + typedef Sphere3 Sphere3f; typedef Sphere3 Sphere3d;