From 26980b3502f37f825457d4cb2b6099506f1729a8 Mon Sep 17 00:00:00 2001 From: ponchio Date: Wed, 29 Sep 2004 13:55:33 +0000 Subject: [PATCH] Added Distance shpere - point. --- vcg/space/sphere3.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/space/sphere3.h b/vcg/space/sphere3.h index 45632998..0a325355 100644 --- a/vcg/space/sphere3.h +++ b/vcg/space/sphere3.h @@ -24,6 +24,9 @@ History $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 Sphere ->Sphere3 @@ -74,6 +77,13 @@ public: }; +template T Distance(const Sphere3 &sphere, + const Point3 &point) { + T dist = Distance(point, sphere.Center()) - sphere.Radius(); + if(dist < 0) dist = 0; + return dist; +} + typedef Sphere3 Sphere3f; typedef Sphere3 Sphere3d;