diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-12-10 13:00:22 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-12-10 13:47:49 -0800 |
commit | 916af615ddef151f78c23d996caf01c18a57e9d8 (patch) | |
tree | 75653b817a6eb478a9328c1d81078ce9fef91a24 /src | |
parent | f59f58169bdbcd72184053c0db49da5ddb4f53e3 (diff) |
v2f: add v2f_invert()
preparatory commit for inverting controls on adult maga mode
Diffstat (limited to 'src')
-rw-r--r-- | src/v2f.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)); |