geom/aabb: move inclusive point query into header
This commit is contained in:
parent
d47f52b63f
commit
e82d770d2b
@ -48,19 +48,7 @@ template <size_t S, typename T>
|
||||
util::extent<S,T>
|
||||
aabb<S,T>::magnitude (void) const
|
||||
{
|
||||
extent<S,T> out;
|
||||
for (size_t i = 0; i < S; ++i)
|
||||
out[i] = p1[i] - p0[i];
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
bool
|
||||
aabb<S,T>::inclusive (point<S,T> p) const
|
||||
{
|
||||
return all (p0 <= p && p1 >= p);
|
||||
return (p1 - p0).template as<util::extent> ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,11 +30,13 @@ namespace util::geom {
|
||||
aabb () = default;
|
||||
aabb (point<S,T>, point<S,T>);
|
||||
|
||||
T diameter (void) const;
|
||||
extent<S,T> magnitude (void) const;
|
||||
T diameter (void) const;
|
||||
|
||||
/// tests whether a point lies within the region, inclusive of borders
|
||||
bool inclusive (point<S,T>) const;
|
||||
constexpr bool
|
||||
inclusive (point<S,T> p) const noexcept
|
||||
{ return all (p0 <= p && p1 >= p); }
|
||||
|
||||
point<S,T> closest (point<S,T>) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user