summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/math.c b/math.c
index 6497040..fe28ef1 100644
--- a/math.c
+++ b/math.c
@@ -195,6 +195,10 @@ static v2 v2_mul(v2 a, v2 b) {
return V2(a.x * b.x, a.y * b.y);
}
+static v2 v2_clamp(v2 x, v2 a, v2 b) {
+ return V2(clampf(x.x, a.x, b.x), clampf(x.y, a.y, b.y));
+}
+
static float v2_dot(v2 a, v2 b) {
return a.x * b.x + a.y * b.y;
}