sphere: give data members proper names

This commit is contained in:
Danny Robson 2015-04-15 14:29:20 +10:00
parent fb97584ad6
commit 3decd9e0ab
2 changed files with 4 additions and 4 deletions

View File

@ -82,8 +82,8 @@ template <size_t S, typename T>
T T
util::ray<S,T>::intersect (sphere<S,T> s) const util::ray<S,T>::intersect (sphere<S,T> s) const
{ {
T b = dot (direction, origin - s.c); T b = dot (direction, origin - s.centre);
T c = dot (origin - s.c, origin - s.c) - s.r * s.r; T c = dot (origin - s.centre, origin - s.centre) - s.radius * s.radius;
T D = b * b - c; T D = b * b - c;
if (D < 0) if (D < 0)

View File

@ -22,8 +22,8 @@
namespace util { namespace util {
template <size_t S, typename T> template <size_t S, typename T>
struct sphere { struct sphere {
point<S,T> c; point<S,T> centre;
T r; T radius;
}; };
typedef sphere<3,float> sphere3f; typedef sphere<3,float> sphere3f;