diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-12 17:09:00 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-01-12 17:09:00 +0000 |
| commit | 906ece7894927983b8ac69e37dd3cb82cfe7aad1 (patch) | |
| tree | c3e83b60f04c5f26975106d807ad5185d20827be /src/game/g_math.h | |
| parent | 99f0a47d6b03b005d0a7dae064cb6eb7cb4f60b5 (diff) | |
| download | zcatch-906ece7894927983b8ac69e37dd3cb82cfe7aad1.tar.gz zcatch-906ece7894927983b8ac69e37dd3cb82cfe7aad1.zip | |
continued the cleanup
Diffstat (limited to 'src/game/g_math.h')
| -rw-r--r-- | src/game/g_math.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/g_math.h b/src/game/g_math.h index e2cf6bd8..54c23ac9 100644 --- a/src/game/g_math.h +++ b/src/game/g_math.h @@ -2,6 +2,8 @@ #ifndef BASE_MATH_H #define BASE_MATH_H +#include <stdlib.h> + template <typename T> inline T clamp(T val, T min, T max) { @@ -22,6 +24,9 @@ inline T mix(const T a, const T b, TB amount) { return a + (b-a)*amount; } + +inline float frandom() { return rand()/(float)(RAND_MAX); } + const float pi = 3.1415926535897932384626433f; template <typename T> inline T min(T a, T b) { return a<b?a:b; } |