Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExMix <rahuba.youri@mapswithme.com>2015-02-09 12:11:57 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2015-11-30 16:04:03 +0300
commitbb625097717a53d80197bf1e1e029cde4dc7a650 (patch)
treecda64b1d825b774137961b43deb4b6979f0062ad /base/math.hpp
parent6295105e60ec7044db56d551194210632f856211 (diff)
[drape] forming geometry for CW triangle order
Diffstat (limited to 'base/math.hpp')
-rw-r--r--base/math.hpp10
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);