sphere: give data members proper names
This commit is contained in:
parent
fb97584ad6
commit
3decd9e0ab
4
ray.cpp
4
ray.cpp
@ -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)
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user