Commit 0ccfd614 authored by Thomas Jund's avatar Thomas Jund

segment-BB test correction (was ray-BB)

parent 21237c6c
......@@ -222,7 +222,7 @@ bool BoundingBox<VEC>::contains(const VEC& a, const VEC& b)
#define MIDDLE 'm'
//Algorithm from Graphic Gems
//modified : do not compute intersection point
//modified to test segment
VEC dir(b-a); /*ray */
bool inside = true;
......@@ -287,10 +287,12 @@ bool BoundingBox<VEC>::contains(const VEC& a, const VEC& b)
coord[i] = a[i] + maxT[whichPlane] *dir[i];
if (coord[i] < m_pMin[i] || coord[i] > m_pMax[i])
return false;
else
coord[i] = candidatePlane[i];
}
}
return true; /* ray hits box */
return VEC(coord-b)*VEC(a-b); /* intersection in segment ?*/
}
template <typename VEC>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment