From c6879ef6e3b051116a3a19c2ab0aaab9a999d3aa Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 14 Dec 2023 21:57:25 -0800 Subject: [PATCH] MathLib: added ValueType parameter to Vector, Matrix and Quaternion types --- Common/interface/BasicMath.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Common/interface/BasicMath.hpp b/Common/interface/BasicMath.hpp index b6dc5e3cd..222c719ee 100644 --- a/Common/interface/BasicMath.hpp +++ b/Common/interface/BasicMath.hpp @@ -73,6 +73,8 @@ template struct Vector4; template struct Vector2 { + using ValueType = T; + union { struct @@ -268,6 +270,8 @@ constexpr Vector2 operator*(T s, const Vector2& a) template struct Vector3 { + using ValueType = T; + union { struct @@ -490,6 +494,8 @@ constexpr Vector3 operator*(T s, const Vector3& a) template struct Vector4 { + using ValueType = T; + union { struct @@ -731,6 +737,8 @@ constexpr Vector4 operator*(T s, const Vector4& a) template struct Matrix2x2 { + using ValueType = T; + union { struct @@ -997,6 +1005,8 @@ inline constexpr Matrix2x2 operator/(const Matrix2x2& Mat, T s) template struct Matrix3x3 { + using ValueType = T; + union { struct @@ -1355,6 +1365,8 @@ inline constexpr Matrix3x3 operator/(const Matrix3x3& Mat, T s) template struct Matrix4x4 { + using ValueType = T; + union { struct @@ -2276,6 +2288,8 @@ using int2x2 = Matrix2x2; template struct Quaternion { + using ValueType = T; + Vector4 q{0, 0, 0, 1}; constexpr Quaternion(const Vector4& _q) noexcept :