aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 54141e3..9825923 100644
--- a/utils.c
+++ b/utils.c
@@ -7,3 +7,9 @@ flerp(double a, double b, double t)
{
return a + (b - a)*t;
}
+
+double
+fclamp(double n, double min, double max)
+{
+ return n < min? min: n > max? max: n;
+}