Added Distance shpere - point.
This commit is contained in:
parent
44f6565e1e
commit
26980b3502
vcg/space
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.4 2004/04/02 09:49:01 ponchio
|
||||||
|
Ehm... a couople of small errors.
|
||||||
|
|
||||||
Revision 1.3 2004/04/02 09:44:13 ponchio
|
Revision 1.3 2004/04/02 09:44:13 ponchio
|
||||||
Sphere ->Sphere3
|
Sphere ->Sphere3
|
||||||
|
|
||||||
|
@ -74,6 +77,13 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
typedef Sphere3<float> Sphere3f;
|
typedef Sphere3<float> Sphere3f;
|
||||||
typedef Sphere3<double> Sphere3d;
|
typedef Sphere3<double> Sphere3d;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue