summaryrefslogtreecommitdiff
path: root/src/math/vec2.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-07-12 13:31:28 +0800
committerchai <chaifix@163.com>2020-07-12 13:31:28 +0800
commita0439c8d387579a1727ad00c2e105e7602aedbb6 (patch)
tree8ea09b13e179a7d8cd9ac6518410cd10035f48f4 /src/math/vec2.c
parentec7aa42781a9108901fbde7210d8285bbbeaf5fc (diff)
+mathlib
Diffstat (limited to 'src/math/vec2.c')
-rw-r--r--src/math/vec2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/vec2.c b/src/math/vec2.c
index dc964e7..c807baf 100644
--- a/src/math/vec2.c
+++ b/src/math/vec2.c
@@ -16,6 +16,12 @@ void internal_vec2_plus(Vec2* v1, Vec2* v2, Vec2* out) {
out->y = v1->y + v2->y;
}
+void internal_vec2_minus(Vec2* v1, Vec2* v2, Vec2* out) {
+ ssr_assert(v1 && v2 && out);
+ out->x = v1->x - v2->x;
+ out->y = v1->y - v2->y;
+}
+
void internal_vec2_offset(Vec2* v, float offset, Vec2* out) {
ssr_assert(v && out);
out->x = v->x + offset;