aboutsummaryrefslogtreecommitdiff
path: root/core/src/Utils/Vector.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/Utils/Vector.hpp')
-rw-r--r--core/src/Utils/Vector.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/src/Utils/Vector.hpp b/core/src/Utils/Vector.hpp
index 7e71b73..3d4d251 100644
--- a/core/src/Utils/Vector.hpp
+++ b/core/src/Utils/Vector.hpp
@@ -15,6 +15,13 @@ struct Vec2
};
}
+ template <class TProxy>
+ void OperateIOProxy(TProxy& proxy)
+ {
+ proxy.Value(x);
+ proxy.Value(y);
+ }
+
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 }; }
@@ -48,6 +55,14 @@ struct Vec3
};
}
+ template <class TProxy>
+ void OperateIOProxy(TProxy& proxy)
+ {
+ proxy.Value(x);
+ proxy.Value(y);
+ proxy.Value(z);
+ }
+
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 }; }
@@ -83,6 +98,15 @@ struct Vec4
};
}
+ template <class TProxy>
+ void OperateIOProxy(TProxy& proxy)
+ {
+ proxy.Value(x);
+ proxy.Value(y);
+ proxy.Value(z);
+ proxy.Value(w);
+ }
+
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 }; }