summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-28 15:44:16 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-28 15:44:16 -0500
commit5b90057859cd38b284573460460ab27bd108aa0e (patch)
tree4b9ac2e17b8eb8f3cc6c3ac042327226b509cccc /math.c
parentaea002f290e5eddde98eb394fa7a9145c325fffe (diff)
finished warn on overwrite
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;
}