geom/aabb: add query for aabb corners

This commit is contained in:
Danny Robson 2018-05-21 10:47:30 +10:00
parent 7070607839
commit 7f00f92e59
2 changed files with 23 additions and 0 deletions

View File

@ -24,6 +24,26 @@
using util::geom::aabb;
///////////////////////////////////////////////////////////////////////////////
template <>
std::array<
util::point3f,8
>
aabb<3,float>::vertices (void) const noexcept
{
return {{
{ lo.x, lo.y, lo.z },
{ lo.x, lo.y, hi.z },
{ lo.x, hi.y, lo.z },
{ lo.x, hi.y, hi.z },
{ hi.x, lo.y, lo.z },
{ hi.x, lo.y, hi.z },
{ hi.x, hi.y, lo.z },
{ hi.x, hi.y, hi.z },
}};
}
///////////////////////////////////////////////////////////////////////////////
namespace util::debug {
template <size_t S, typename T>

View File

@ -117,6 +117,9 @@ namespace util::geom {
};
}
std::array<util::point<S,T>,util::pow(2,S)>
vertices (void) const noexcept;
::util::point<S,T> lo;
::util::point<S,T> hi;