Distance functions moved to distance3.h

This commit is contained in:
Nico Pietroni 2010-10-15 15:17:15 +00:00
parent 793cf46180
commit e690807441
1 changed files with 14 additions and 14 deletions

View File

@ -104,20 +104,20 @@ protected:
T threshold = 1.01, T speed = 0.6);
};
template <class T> T Distance(const Sphere3<T> &sphere,
const Point3<T> &point) {
T dist = Distance(point, sphere.Center()) - sphere.Radius();
if(dist < 0) dist = 0;
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;
}
//template <class T> T Distance(const Sphere3<T> &sphere,
// const Point3<T> &point) {
// T dist = Distance(point, sphere.Center()) - sphere.Radius();
// if(dist < 0) dist = 0;
// 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<double> Sphere3d;