Recast Navigation  1.0.35
Util.h File Reference

Go to the source code of this file.

Functions

General helper functions
template<class T >
void rcSwap (T &a, T &b)
 Swaps the values of the two parameters. More...
 
template<class T >
rcMin (T a, T b)
 Returns the minimum of two values. More...
 
template<class T >
rcMax (T a, T b)
 Returns the maximum of two values. More...
 
template<class T >
rcAbs (T a)
 Returns the absolute value. More...
 
template<class T >
rcSqr (T a)
 Returns the square of the value. More...
 
template<class T >
rcClamp (T v, T mn, T mx)
 Clamps the value to the specified range. More...
 
float rcSqrt (float x)
 Returns the square root of the value. More...
 

Function Documentation

template<class T >
T rcAbs ( a)
inline

Returns the absolute value.

Parameters
[in]aThe value.
Returns
The absolute value of the specified value.
template<class T >
T rcClamp ( v,
mn,
mx 
)
inline

Clamps the value to the specified range.

Parameters
[in]vThe value to clamp.
[in]mnThe minimum permitted return value.
[in]mxThe maximum permitted return value.
Returns
The value, clamped to the specified range.
template<class T >
T rcMax ( a,
b 
)
inline

Returns the maximum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The maximum of the two values.
template<class T >
T rcMin ( a,
b 
)
inline

Returns the minimum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The minimum of the two values.
template<class T >
T rcSqr ( a)
inline

Returns the square of the value.

Parameters
[in]aThe value.
Returns
The square of the value.
float rcSqrt ( float  x)

Returns the square root of the value.

Parameters
[in]xThe value.
Returns
The square root of the vlaue.
template<class T >
void rcSwap ( T &  a,
T &  b 
)
inline

Swaps the values of the two parameters.

Parameters
[in,out]aValue A
[in,out]bValue B