24 #include "../Utils_LIB/UTypes.h"
43 namespace OpenSkyNet {
47 const float PI(3.14159265f);
57 inline float rand01() {
return static_cast<float>(rand()) / static_cast<float>(RAND_MAX); }
60 inline float randNeg1Pos1() {
return ((static_cast<float>(rand()) / (static_cast<float>(RAND_MAX)/2.0f)) - 1.0f); }
63 inline int roundToInt(
double num_) {
return static_cast<int>(num_+(num_>=0.0?0.5:-0.5)); }
77 inline T
clamp(T& num_,
const T& min_=0,
const T& max_=1) {
long CLK_TCK
Definition: MFun.cpp:4
const float DEGREES_TO_RADIANS(0.01745329f)
int roundToInt(double num_)
Definition: MFun.h:63
T clamp(T &num_, const T &min_=0, const T &max_=1)
Definition: MFun.h:77
Utils::uint roundToUInt(float num_)
Definition: MFun.h:66
const float PSEUDO_INFINITY(1000000.0f)
unsigned int uint
Definition: UTypes.h:39
Utils::uint timeStamp()
Definition: MFun.h:69
float randNeg1Pos1()
Definition: MFun.h:60
const float PI(3.14159265f)
const float CLOSE_TO_ZERO(0.00001f)
float getRadFromDeg(float deg_)
Definition: MFun.h:54
const float RADIANS_TO_DEGREES(57.29577951f)
float rand01()
Definition: MFun.h:57