This commit is contained in:
Federico Ponchio 2004-12-01 16:06:59 +00:00
parent f667ed41d8
commit 6a03b9d31c
1 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $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 Revision 1.4 2004/04/02 09:49:01 ponchio
Ehm... a couople of small errors. Ehm... a couople of small errors.
@ -84,6 +87,14 @@ template <class T> T Distance(const Sphere3<T> &sphere,
return dist; return dist;
} }
template <class T> T Distance(const Sphere3<T> &sphere,
const Sphere3<T> &s) {
T dist = Distance(s.Center(), sphere.Center())
- sphere.Radius() - s.Radius();
if(dist < 0) dist = 0;
return dist;
}
typedef Sphere3<float> Sphere3f; typedef Sphere3<float> Sphere3f;
typedef Sphere3<double> Sphere3d; typedef Sphere3<double> Sphere3d;