aboutsummaryrefslogtreecommitdiff
path: root/src/math/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/vector.h')
-rw-r--r--src/math/vector.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/vector.h b/src/math/vector.h
index d755c89..fcfc5bd 100644
--- a/src/math/vector.h
+++ b/src/math/vector.h
@@ -33,6 +33,12 @@ struct Vector2 {
return *this + (-other);
}
+ constexpr Vector2 operator+=(const Vector2& other) & {
+ x += other.x;
+ y += other.y;
+ return *this;
+ }
+
constexpr float det(const Vector2& other) const & {
return this->x * other.y - other.x * this->y;
}