From d7c051cecf0db9056e94d5e80146aa0b066e606b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 4 Nov 2021 13:49:05 +0800 Subject: *text alignment --- Runtime/Math/Vector4.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Runtime/Math/Vector4.h') diff --git a/Runtime/Math/Vector4.h b/Runtime/Math/Vector4.h index c0f99f2..e56a1a7 100644 --- a/Runtime/Math/Vector4.h +++ b/Runtime/Math/Vector4.h @@ -2,12 +2,12 @@ namespace Internal { - - struct Vector4 + template + struct Vector4T { - float x, y, z, w; + T x, y, z, w; - Vector4(float x = 0, float y = 0, float z = 0, float w = 0) + Vector4T(T x = 0, T y = 0, T z = 0, T w = 0) { this->x = x; this->y = y; @@ -15,7 +15,7 @@ namespace Internal this->w = w; } - inline void Set(float x, float y, float z, float w) + inline void Set(T x, T y, T z, T w) { this->x = x; this->y = y; @@ -23,10 +23,13 @@ namespace Internal this->w = w; } - - static Vector4 zero; - static Vector4 one; + static Vector4T zero; + static Vector4T one; }; + template + Vector4T Vector4T::zero = Vector4T(0, 0, 0, 0); + template + Vector4T Vector4T::one = Vector4T(1, 1, 1, 1); } -- cgit v1.1-26-g67d0