Clamp
This function clamps a number between a minimum and maximum limit and returns the result.
Syntax
- static float Clamp(const float f, const float min=0, const float max=1)
Parameters
- f: the number to clamp.
- min: the lower limit.
- max: the upper limit.
Returns
If the number f is less than the min, the min is returned. If the number f is greater than the max, the max is returned. Otherwise, f is returned.