From 91d3a0352088611d3b78d3344b7a2bf2d4955a0a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 6 May 2008 21:07:11 +0000 Subject: client-side frame interpolation: frames and timers --- src/math/functions.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/math') 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__ -- cgit v1.2.3