diff options
Diffstat (limited to 'src/math.hpp')
-rw-r--r-- | src/math.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/math.hpp b/src/math.hpp index 7cbd829..97e3b6b 100644 --- a/src/math.hpp +++ b/src/math.hpp @@ -379,6 +379,15 @@ public: return v[0] / 2 + v[1] / 2; } + bool contains(vec_t<T, N> &u) const + { + for (size_t i = 0; i < N; i++) + if (u[i] < v[0][i] || u[i] > v[1][i]) + return false; + + return true; + } + friend bool operator&&(const rect_t<T, N> &a, const rect_t<T, N> &b) { for (size_t i = 0; i < N; i++) |