diff options
author | vimene <vincent.menegaux@gmail.com> | 2025-01-03 04:02:23 +0100 |
---|---|---|
committer | vimene <vincent.menegaux@gmail.com> | 2025-01-03 04:02:23 +0100 |
commit | 77cd3a0538d342e25010132317734f27af4bed8e (patch) | |
tree | 372d57aa2a76437d80c9312f1e81a54439bf9b42 /src/math/vector.h | |
parent | 26b4b82a7be2c029491f3009b66b3cbf8db5d93c (diff) | |
download | engine-77cd3a0538d342e25010132317734f27af4bed8e.tar.gz |
improved keyboard and mouse controls
Diffstat (limited to 'src/math/vector.h')
-rw-r--r-- | src/math/vector.h | 6 |
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; } |