aabb: add point overlap check
This commit is contained in:
parent
14e5f4ca2d
commit
ace0fd4a99
13
aabb.cpp
13
aabb.cpp
@ -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>
|
template <size_t S, typename T>
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user