region: add free function point intersection test

This commit is contained in:
Danny Robson 2018-06-05 09:28:49 +10:00
parent 33222d3ef4
commit 50f43d2193

View File

@ -230,6 +230,15 @@ namespace util {
} }
template <size_t S, typename T>
bool
intersects (util::region<S,T> const area,
util::point<S,T> const query)
{
return area.inclusive (query);
}
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)