diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-04-21 19:42:06 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-04-21 19:42:06 +0200 |
commit | 760a85015720ba4177a116678cfd305fe1ff2ea9 (patch) | |
tree | ca349b4c719b6a7106a2d1a875aaa7601c806fe1 /src/math.hpp | |
parent | c3a8bc36ce75984bdb5a54fbae4f77d84e4efbcc (diff) |
Gathering mechanic for scientists.
Diffstat (limited to 'src/math.hpp')
-rw-r--r-- | src/math.hpp | 6 |
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++) |