diff options
author | chai <chaifix@163.com> | 2018-10-23 12:23:58 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-23 12:23:58 +0800 |
commit | 40fc27154fe754181934dc7ee31375e6bdfb33fc (patch) | |
tree | 897ad98d759bc308ef66561181ba88b85f2ccd47 /src/libjin/Math/je_vector2.hpp | |
parent | 1480c9445100075c9e1a894eb07c0ef727b509a1 (diff) |
*merge from minimal
Diffstat (limited to 'src/libjin/Math/je_vector2.hpp')
-rw-r--r-- | src/libjin/Math/je_vector2.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libjin/Math/je_vector2.hpp b/src/libjin/Math/je_vector2.hpp new file mode 100644 index 0000000..a2b3371 --- /dev/null +++ b/src/libjin/Math/je_vector2.hpp @@ -0,0 +1,40 @@ +#ifndef __JE_VECTOR_H +#define __JE_VECTOR_H + +namespace JinEngine +{ + namespace Math + { + + template<typename T> + class Vector2 + { + public: + Vector2() + { + data[0] = data[1] = 0; + } + Vector2(T _x, T _y) + { + data[0] = _x; + data[1] = _y; + } + Vector2(const Vector2<T>& v) + { + data[0] = v.data[0]; + data[1] = v.data[1]; + } + + T &x = data[0], &y = data[1]; // xy + T &w = data[0], &h = data[1]; // wh + T &colum = data[0], &row = data[1]; // colum row + + private: + T data[2]; + + }; + + } // namespace Math +} // namespace JinEngine + +#endif
\ No newline at end of file |