mirror of
https://github.com/AxioDL/zeus.git
synced 2025-07-09 14:45:56 +00:00
made clamp a template function
This commit is contained in:
parent
2e3512b800
commit
151b0e6333
@ -16,8 +16,8 @@
|
||||
|
||||
namespace Math
|
||||
{
|
||||
inline void clamp(float& val, float min, float max) {val = MAX(min, MIN(max, val));}
|
||||
inline void clamp(int& val, int min, int max) {val = MAX(min, MIN(max, val));}
|
||||
template<typename T>
|
||||
inline T clamp(T min, T val, T max) {return MAX(min, MIN(max, val));}
|
||||
|
||||
inline float radToDeg(float rad) {return rad * 180.f / M_PI;}
|
||||
inline float degToRad(float deg) {return deg * M_PI / 180;}
|
||||
|
Loading…
x
Reference in New Issue
Block a user