diff --git a/vcg/space/sphere3.h b/vcg/space/sphere3.h index 010790d4..45632998 100644 --- a/vcg/space/sphere3.h +++ b/vcg/space/sphere3.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.3 2004/04/02 09:44:13 ponchio +Sphere ->Sphere3 + Revision 1.2 2004/03/25 17:25:46 ponchio #include sbagliato. @@ -54,8 +57,8 @@ protected: Point3 _center; T _radius; public: - Sphere(): radius(-1) {} - Sphere(const Point3 ¢er, T radius): _center(center), _radius(radius) {} + Sphere3(): _radius(-1) {} + Sphere3(const Point3 ¢er, T radius): _center(center), _radius(radius) {} T &Radius() { return _radius; } const T &Radius() const { return _radius; } @@ -74,12 +77,12 @@ public: typedef Sphere3 Sphere3f; typedef Sphere3 Sphere3d; -template void Sphere::Add(const Sphere &sphere) { +template void Sphere3::Add(const Sphere3 &sphere) { if(IsEmpty()) { *this = sphere; return; } - Point3 dist = sphere.center - _center; + Point3 dist = sphere.Center() - _center; float distance = dist.Norm(); float fartest = distance + sphere.Radius(); @@ -93,7 +96,7 @@ template void Sphere::Add(const Sphere &sphere) { } } -template void Sphere::Add(Point3 &p) { +template void Sphere3::Add(Point3 &p) { if(IsEmpty()) { _center = p; _radius = 0; @@ -105,7 +108,7 @@ template void Sphere::Add(Point3 &p) { _radius = (_radius + fartest)/2; } -template bool Sphere::IsIn(const Point3 &p) const { +template bool Sphere3::IsIn(const Point3 &p) const { Point3 dist = p - _center; return dist.Norm() <= _radius; }