summaryrefslogtreecommitdiff
path: root/src/math.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/math.hpp')
-rw-r--r--src/math.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math.hpp b/src/math.hpp
index 97e3b6b..d0b474e 100644
--- a/src/math.hpp
+++ b/src/math.hpp
@@ -388,6 +388,12 @@ public:
return true;
}
+ static rect_t<T, N> around(vec_t<T, N> v, T r)
+ {
+ vec_t<T, N> R(r, r);
+ return rect_t<T, N>(v - R, v + R);
+ }
+
friend bool operator&&(const rect_t<T, N> &a, const rect_t<T, N> &b)
{
for (size_t i = 0; i < N; i++)