diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2015-02-09 12:11:57 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 16:04:03 +0300 |
commit | bb625097717a53d80197bf1e1e029cde4dc7a650 (patch) | |
tree | cda64b1d825b774137961b43deb4b6979f0062ad /base/math.hpp | |
parent | 6295105e60ec7044db56d551194210632f856211 (diff) |
[drape] forming geometry for CW triangle order
Diffstat (limited to 'base/math.hpp')
-rw-r--r-- | base/math.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/math.hpp b/base/math.hpp index 78b59dd335..92ac40ab06 100644 --- a/base/math.hpp +++ b/base/math.hpp @@ -103,6 +103,16 @@ inline T clamp(T x, TMin xmin, TMax xmax) return x; } +template <typename T> +inline T cyclicClamp(T x, T xmin, T xmax) +{ + if (x > xmax) + return xmin; + if (x < xmin) + return xmax; + return x; +} + template <typename T> inline bool between_s(T a, T b, T x) { return (a <= x && x <= b); |