aabb: add point overlap check

This commit is contained in:
Danny Robson 2015-04-07 23:10:31 +10:00
parent 14e5f4ca2d
commit ace0fd4a99
2 changed files with 15 additions and 0 deletions

View File

@ -45,6 +45,19 @@ AABB<S,T>::magnitude (void) const
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
bool
AABB<S,T>::overlaps (point<S,T> p) const
{
for (size_t i = 0; i < S; ++i)
if (p0[i] > p[i] || p1[i] < p[i])
return false;
return true;
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
void

View File

@ -35,6 +35,8 @@ namespace util {
extent<S,T> magnitude (void) const;
bool overlaps (point<S,T>) const;
void expand (point<S,T>);
AABB<S,T> operator+ (vector<S,T>) const;