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/Vector3.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Runtime/Math/Vector3.h') diff --git a/Runtime/Math/Vector3.h b/Runtime/Math/Vector3.h index e81e880..c7e5232 100644 --- a/Runtime/Math/Vector3.h +++ b/Runtime/Math/Vector3.h @@ -3,17 +3,17 @@ namespace Internal { - - struct Vector3 + template + struct Vector3T { - float x, y, z; - Vector3(float x = 0, float y = 0, float z = 0) + T x, y, z; + Vector3T(T x = 0, T y = 0, T z = 0) { this->x = x; this->y = y; this->z = z; } - inline void Set(float x, float y, float z) + inline void Set(T x, T y, T z) { this->x = x; this->y = y; @@ -21,11 +21,15 @@ namespace Internal } - static Vector3 zero; - static Vector3 one; + static Vector3T zero; + static Vector3T one; }; + template + Vector3T Vector3T::zero = Vector3T(0, 0, 0); + template + Vector3T Vector3T::one = Vector3T(1, 1, 1); } #endif \ No newline at end of file -- cgit v1.1-26-g67d0