clamp.cpp 161 Bytes
Newer Older
Jake Read's avatar
Jake Read committed
1
2
3
4
5
6
7
8
9
#include "clamp.h"

void clamp(float *val, float min, float max){
    if(*val < min){
        *val = min;
    } else if (*val > max){
        *val = max;
    }
}