g/cylinder: use (barely) saner member names

This commit is contained in:
Danny Robson 2015-10-15 00:38:54 +11:00
parent ac06282f03
commit b47cb6c560
2 changed files with 7 additions and 7 deletions

View File

@ -22,16 +22,16 @@ using util::geom::cylinder;
///////////////////////////////////////////////////////////////////////////////
template <size_t S, typename T>
bool
cylinder<S,T>::includes (util::point<S,T> p) const
cylinder<S,T>::includes (util::point<S,T> p_) const
{
auto ab = b - a;
auto pa = p - a;
auto p10 = p1 - p0;
auto p_0 = p_ - p0;
auto l = dot (ab, pa);
if (l < 0 || l > ab.magnitude2 ())
auto l = dot (p10, p_0);
if (l < 0 || l > p10.magnitude2 ())
return false;
auto d = dot (pa, pa) - l * l * ab.magnitude2 ();
auto d = dot (p10, p10) - l * l * p10.magnitude2 ();
if (d > radius * radius)
return false;

View File

@ -23,7 +23,7 @@ namespace util { namespace geom {
///////////////////////////////////////////////////////////////////////////
template <size_t S, typename T>
struct cylinder {
util::point<S,T> a, b;
util::point<S,T> p0, p1;
T radius;
float distance (util::point<S,T>) const;