From 77cd3a0538d342e25010132317734f27af4bed8e Mon Sep 17 00:00:00 2001 From: vimene Date: Fri, 3 Jan 2025 04:02:23 +0100 Subject: improved keyboard and mouse controls --- src/math/vector.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/math/vector.h') 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; } -- cgit v1.2.3