summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-12-10 13:00:22 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-12-10 13:47:49 -0800
commit916af615ddef151f78c23d996caf01c18a57e9d8 (patch)
tree75653b817a6eb478a9328c1d81078ce9fef91a24 /src
parentf59f58169bdbcd72184053c0db49da5ddb4f53e3 (diff)
v2f: add v2f_invert()
preparatory commit for inverting controls on adult maga mode
Diffstat (limited to 'src')
-rw-r--r--src/v2f.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/v2f.h b/src/v2f.h
index db085b3..3f13b29 100644
--- a/src/v2f.h
+++ b/src/v2f.h
@@ -54,6 +54,13 @@ static inline float v2f_dot(v2f_t *a, v2f_t *b)
}
+static inline v2f_t v2f_invert(v2f_t *v)
+{
+ return (v2f_t){ .x = -v->x, .y = -v->y };
+
+}
+
+
static inline float v2f_length(v2f_t *v)
{
return sqrtf(v2f_dot(v, v));
© All Rights Reserved