aboutsummaryrefslogtreecommitdiffstats
path: root/include/vec2.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/vec2.hpp')
-rw-r--r--include/vec2.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/vec2.hpp b/include/vec2.hpp
index dcd4b93..6b3c30a 100644
--- a/include/vec2.hpp
+++ b/include/vec2.hpp
@@ -4,6 +4,10 @@
struct Vec2 {
float x, y;
+ auto operator+(const Vec2& o) const noexcept {
+ return Vec2 {x + o.x, y + o.y};
+ }
+
auto& operator+=(const Vec2& o) noexcept {
x += o.x;
y += o.y;