region: add intersects overload for point/region

complements the existing region/point intersects test
This commit is contained in:
Danny Robson 2018-06-07 15:20:05 +10:00
parent 6d6c53d5d1
commit c4a8ff3424

View File

@ -239,6 +239,20 @@ namespace util {
} }
///------------------------------------------------------------------------
/// returns true if the supplied point lies within the supplied region
/// inclusive of borders.
template <size_t S, typename T>
bool
intersects (util::point<S,T> const query,
util::region<S,T> const area)
{
return intersects (area, query);
}
///////////////////////////////////////////////////////////////////////////
/// returns a uniformly randomly sampled point within the supplied region
template <size_t S, typename T, typename GeneratorT> template <size_t S, typename T, typename GeneratorT>
util::point<S,T> util::point<S,T>
sample (region<S,T> shape, GeneratorT &&gen) sample (region<S,T> shape, GeneratorT &&gen)