geom/aabb: add a cast call

This commit is contained in:
Danny Robson 2020-06-18 12:45:08 +10:00
parent 750b3b6519
commit 3f6964f257

View File

@ -34,6 +34,21 @@ namespace cruft::geom {
}
///////////////////////////////////////////////////////////////////////
/// Returns a copy of the AABB with all elements implicitly cast to the
/// type `DestinationT`.
template <typename DestinationT>
constexpr aabb<S, DestinationT>
cast (void) const
{
return {
lo.template cast<DestinationT> (),
hi.template cast<DestinationT> ()
};
}
///////////////////////////////////////////////////////////////////////
extent<S,T>
magnitude (void) const