diff options
author | chai <chaifix@163.com> | 2021-11-04 13:49:05 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-04 13:49:05 +0800 |
commit | d7c051cecf0db9056e94d5e80146aa0b066e606b (patch) | |
tree | da7a96046faa3323d1171d782164d3aae50ce322 /Runtime/Math/Vector4.h | |
parent | d24f17b88d901b779c81c7434995675eb2a17429 (diff) |
*text alignment
Diffstat (limited to 'Runtime/Math/Vector4.h')
-rw-r--r-- | Runtime/Math/Vector4.h | 19 |
1 files changed, 11 insertions, 8 deletions
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<typename T> + 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<typename T> + Vector4T<T> Vector4T<T>::zero = Vector4T(0, 0, 0, 0); + template<typename T> + Vector4T<T> Vector4T<T>::one = Vector4T(1, 1, 1, 1); } |