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
|
||||
util::ray<S,T>::intersect (sphere<S,T> s) const
|
||||
{
|
||||
T b = dot (direction, origin - s.c);
|
||||
T c = dot (origin - s.c, origin - s.c) - s.r * s.r;
|
||||
T b = dot (direction, origin - s.centre);
|
||||
T c = dot (origin - s.centre, origin - s.centre) - s.radius * s.radius;
|
||||
|
||||
T D = b * b - c;
|
||||
if (D < 0)
|
||||
|
@ -22,8 +22,8 @@
|
||||
namespace util {
|
||||
template <size_t S, typename T>
|
||||
struct sphere {
|
||||
point<S,T> c;
|
||||
T r;
|
||||
point<S,T> centre;
|
||||
T radius;
|
||||
};
|
||||
|
||||
typedef sphere<3,float> sphere3f;
|
||||
|
Loading…
Reference in New Issue
Block a user