2 #define _USE_MATH_DEFINES
4 #include <boost/foreach.hpp>
5 #define foreach BOOST_FOREACH
9 inline float deg2rad( float deg )
11 return deg / 180.0f * static_cast<float>(M_PI);
14 inline float rad2deg( float rad )
16 return rad / static_cast<float>(M_PI) * 180.0f;
19 template< typename T , int N >
20 int lengthOf( T (&)[N] )
25 template< typename T , int N >
26 T& lastOf( T(&arr)[N] )
31 template< typename T >
32 void safe_delete( T* (&p) )
38 template< typename T >
39 void safe_delete_array( T* (&p) )
45 inline int rotation_mod(int a , unsigned int b)