geom/aabb: add or'ing operator for points
This commit is contained in:
parent
073b41da42
commit
09dfad5391
@ -93,6 +93,23 @@ namespace util::geom {
|
||||
}
|
||||
|
||||
|
||||
/// returns an aabb that covers the supplied point in addition to the
|
||||
/// current aabb area.
|
||||
auto operator| [[nodiscard]] (point<S,T> p) const noexcept
|
||||
{
|
||||
return aabb (
|
||||
util::min (lo, p),
|
||||
util::max (hi, p)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
auto& operator|= (point<S,T> p) noexcept
|
||||
{
|
||||
return *this = *this | p;
|
||||
}
|
||||
|
||||
|
||||
::util::point<S,T> lo;
|
||||
::util::point<S,T> hi;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user