diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-04-12 14:00:53 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-04-12 14:00:53 +0200 |
commit | a5b20dcd57ddf7bdac8d9bce1aabf934badd837d (patch) | |
tree | e05853e98e2481f5ac939919b58227190e1a07d0 /src/math.hpp | |
parent | 30c5c419aedd0e5aae92be6e0eee83f0b6690c6e (diff) |
Ray tracing against cmodels (WIP).
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++) |