// Includes #ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include #endif #include "funcs.h" float quake_root(float number) { long i; float x, y; const float f = 1.5f; x = number * 0.5f; y = number; i = * ( long * ) &y; i = 0x5f3759df - ( i >> 1 ); y = * ( float * ) &i; y = y * ( f - ( x * y * y ) ); y = y * ( f - ( x * y * y ) ); return number * y; } float vec_len2f(float x, float y) { return (quake_root((x * x) + (y * y))); } float vec_len3f(float x, float y, float z) { return (quake_root((x * x) + (y * y) + (z * z))); }