diff options
author | tfarley <tfarleygithub@gmail.com> | 2015-05-18 21:21:33 -0700 |
---|---|---|
committer | tfarley <tfarleygithub@gmail.com> | 2015-05-22 15:51:18 -0700 |
commit | 05dc633a8c35221ce8d6abe6ddf027f8b0bab6c2 (patch) | |
tree | d080c1efd3b928bda551cb9eee304547e66a4351 /src/common/math_util.h | |
parent | 6d995b1ff654483f830b6c285629545263393d7e (diff) |
OpenGL renderer
Diffstat (limited to 'src/common/math_util.h')
-rw-r--r-- | src/common/math_util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h index 0b1400b41c..4b0910741e 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -11,6 +11,10 @@ namespace MathUtil { +inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, unsigned length1) { + return (std::max(start0, start1) <= std::min(start0 + length0, start1 + length1)); +} + template<typename T> inline T Clamp(const T val, const T& min, const T& max) { |