X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhypersphere.h;h=cbec2d99af744e7182f4b5f0081379b059a14d95;hb=827b227ae53884109b6885ccd1424dda8c0b3725;hp=de028fa580d627ed06d1cb811f43b104a450ed7a;hpb=cc51208545c3941fcfdb078ad0c70c7fd607614e;p=libs%2Fmath.git diff --git a/source/geometry/hypersphere.h b/source/geometry/hypersphere.h index de028fa..cbec2d9 100644 --- a/source/geometry/hypersphere.h +++ b/source/geometry/hypersphere.h @@ -23,7 +23,7 @@ private: T radius; public: - HyperSphere(); + HyperSphere(): radius(1) { } explicit HyperSphere(T); virtual HyperSphere *clone() const; @@ -37,11 +37,6 @@ public: virtual unsigned get_intersections(const Ray &, SurfacePoint *, unsigned) const; }; -template -inline HyperSphere::HyperSphere(): - radius(1) -{ } - template inline HyperSphere::HyperSphere(T r): radius(r) @@ -94,10 +89,10 @@ inline unsigned HyperSphere::get_intersections(const Ray &ray, Surfa T offset = sqrt(offset_sq); unsigned n = 0; - for(int i=-1; i<=1; i+=2) + for(int i=-1; (n::get_intersections(const Ray &ray, Surfa } ++n; - if(n==size) - return n; } }