18 template<
class T>
inline void rcSwap(T& a, T& b) { T t = a; a = b; b = t; }
24 template<
class T>
inline T
rcMin(T a, T b) {
return a < b ? a : b; }
30 template<
class T>
inline T
rcMax(T a, T b) {
return a > b ? a : b; }
35 template<
class T>
inline T
rcAbs(T a) {
return a < 0 ? -a : a; }
40 template<
class T>
inline T
rcSqr(T a) {
return a*a; }
47 template<
class T>
inline T
rcClamp(T v, T mn, T mx) {
return v < mn ? mn : (v > mx ? mx : v); }
T rcMax(T a, T b)
Returns the maximum of two values.
Definition: Util.h:30
T rcAbs(T a)
Returns the absolute value.
Definition: Util.h:35
void rcSwap(T &a, T &b)
Swaps the values of the two parameters.
Definition: Util.h:18
T rcMin(T a, T b)
Returns the minimum of two values.
Definition: Util.h:24
float rcSqrt(float x)
Returns the square root of the value.
Definition: Recast.cpp:30
T rcSqr(T a)
Returns the square of the value.
Definition: Util.h:40
T rcClamp(T v, T mn, T mx)
Clamps the value to the specified range.
Definition: Util.h:47