diff options
author | rtk0c <[email protected]> | 2021-05-16 20:56:04 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-05-16 21:15:43 -0700 |
commit | dc13110c14bf49e495d4b4243fd4758232f8716f (patch) | |
tree | 8b5f6bbefab78c4956951e40cf18d6f3a3f604d6 /core/src/Utils/Vector.hpp | |
parent | 203d65e8873f2f1d240b22899ac89855b64974c8 (diff) |
TableTemplate draft
Diffstat (limited to 'core/src/Utils/Vector.hpp')
-rw-r--r-- | core/src/Utils/Vector.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/Utils/Vector.hpp b/core/src/Utils/Vector.hpp index bf75fd1..f49965e 100644 --- a/core/src/Utils/Vector.hpp +++ b/core/src/Utils/Vector.hpp @@ -6,6 +6,8 @@ struct Vec2 T x = 0; T y = 0; + friend constexpr bool operator==(const Vec2& a, const Vec2& b) = default; + friend constexpr Vec2 operator+(const Vec2& a, const Vec2& b) { return { a.x + b.x, a.y + b.y }; } friend constexpr Vec2 operator-(const Vec2& a, const Vec2& b) { return { a.x - b.x, a.y - b.y }; } friend constexpr Vec2 operator*(const Vec2& a, const Vec2& b) { return { a.x * b.x, a.y * b.y }; } @@ -27,6 +29,8 @@ struct Vec3 T y = 0; T z = 0; + friend constexpr bool operator==(const Vec3& a, const Vec3& b) = default; + friend constexpr Vec3 operator+(const Vec3& a, const Vec3& b) { return { a.x + b.x, a.y + b.y, a.z + b.z }; } friend constexpr Vec3 operator-(const Vec3& a, const Vec3& b) { return { a.x - b.x, a.y - b.y, a.z - b.z }; } friend constexpr Vec3 operator*(const Vec3& a, const Vec3& b) { return { a.x * b.x, a.y * b.y, a.z * b.z }; } @@ -49,6 +53,8 @@ struct Vec4 T z = 0; T w = 0; + friend constexpr bool operator==(const Vec4& a, const Vec4& b) = default; + friend constexpr Vec4 operator+(const Vec4& a, const Vec4& b) { return { a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w }; } friend constexpr Vec4 operator-(const Vec4& a, const Vec4& b) { return { a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w }; } friend constexpr Vec4 operator*(const Vec4& a, const Vec4& b) { return { a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w }; } |