summaryrefslogtreecommitdiff
path: root/Runtime/Math/Vector4.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Math/Vector4.h')
-rw-r--r--Runtime/Math/Vector4.h19
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);
}