Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-06 21:07:11 +0000
committerStijn Buys <ingar@osirion.org>2008-05-06 21:07:11 +0000
commit91d3a0352088611d3b78d3344b7a2bf2d4955a0a (patch)
tree74c0a6adf15ae15aa144f66f20272c1fd58a7db3 /src/math
parent8fefc1d995083f0d4a9873f216ccc6e15688d0a9 (diff)
client-side frame interpolation: frames and timers
Diffstat (limited to 'src/math')
-rw-r--r--src/math/functions.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/functions.h b/src/math/functions.h
index b44a4e5..16de778 100644
--- a/src/math/functions.h
+++ b/src/math/functions.h
@@ -55,6 +55,12 @@ inline void clamp(float &value, float min=0.0f, float max=1.0f)
if (value < min) value = min; else if (value > max) value = max;
}
+/// return the absolute value of a float
+inline float absf(float f)
+{
+ if (f >0) return f; else return -f;
+}
+
} // namespace math
#endif // __INCLUDED_MATH_FUNCTIONS_H__