diff --git a/sphere.cpp b/sphere.cpp index 4419219a..827fc546 100644 --- a/sphere.cpp +++ b/sphere.cpp @@ -19,4 +19,14 @@ using util::sphere; //----------------------------------------------------------------------------- +template +sphere::sphere (point _centre, T _radius): + centre (_centre), + radius (_radius) +{ + CHECK_GE (_radius, 0); +} + +//----------------------------------------------------------------------------- +template struct util::sphere<2,float>; template struct util::sphere<3,float>; diff --git a/sphere.hpp b/sphere.hpp index 7fb965e5..2896d64d 100644 --- a/sphere.hpp +++ b/sphere.hpp @@ -22,10 +22,13 @@ namespace util { template struct sphere { + sphere (point centre, T radius); + point centre; T radius; }; + typedef sphere<2,float> sphere2f; typedef sphere<3,float> sphere3f; }