region: add intersects overload for point/region
complements the existing region/point intersects test
This commit is contained in:
parent
6d6c53d5d1
commit
c4a8ff3424
14
region.hpp
14
region.hpp
@ -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>
|
||||
util::point<S,T>
|
||||
sample (region<S,T> shape, GeneratorT &&gen)
|
||||
|
Loading…
Reference in New Issue
Block a user