aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Math
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Math')
-rw-r--r--src/libjin/Math/Vector.cpp24
-rw-r--r--src/libjin/Math/Vector.h24
-rw-r--r--src/libjin/Math/Vector2.cpp9
-rw-r--r--src/libjin/Math/Vector2.h29
4 files changed, 38 insertions, 48 deletions
diff --git a/src/libjin/Math/Vector.cpp b/src/libjin/Math/Vector.cpp
deleted file mode 100644
index b4e347a..0000000
--- a/src/libjin/Math/Vector.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "vector.h"
-
-namespace jin
-{
-namespace math
-{
-
- Vector2::Vector2()
- :x(0), y(0)
- {
- }
-
- Vector2::Vector2(float _x, float _y)
- : x(_x), y(_y)
- {
- };
-
- Vector2::Vector2(const Vector2& v)
- : x(v.x), y(v.y)
- {
- }
-
-} // math
-} // jin \ No newline at end of file
diff --git a/src/libjin/Math/Vector.h b/src/libjin/Math/Vector.h
deleted file mode 100644
index 0fbdc87..0000000
--- a/src/libjin/Math/Vector.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __JIN_VECTOR_H
-#define __JIN_VECTOR_H
-
-namespace jin
-{
-namespace math
-{
-
- class Vector2
- {
- public:
- Vector2();
- Vector2(float _x, float _y);
- Vector2(const Vector2& v);
-
- float x;
- float y;
-
- };
-
-} // math
-} // jin
-
-#endif \ No newline at end of file
diff --git a/src/libjin/Math/Vector2.cpp b/src/libjin/Math/Vector2.cpp
new file mode 100644
index 0000000..737c496
--- /dev/null
+++ b/src/libjin/Math/Vector2.cpp
@@ -0,0 +1,9 @@
+#include "Vector2.h"
+
+namespace jin
+{
+namespace math
+{
+
+} // math
+} // jin \ No newline at end of file
diff --git a/src/libjin/Math/Vector2.h b/src/libjin/Math/Vector2.h
new file mode 100644
index 0000000..ce96ac8
--- /dev/null
+++ b/src/libjin/Math/Vector2.h
@@ -0,0 +1,29 @@
+#ifndef __JIN_VECTOR_H
+#define __JIN_VECTOR_H
+
+namespace jin
+{
+namespace math
+{
+
+ template<typename T>
+ class Vector2
+ {
+ public:
+ Vector2() : x(0), y(0) {};
+ Vector2(T _x, T _y) :x(_x), y(_y) {};
+ Vector2(const Vector2<T>& v)
+ {
+ x = v.x;
+ y = v.y;
+ }
+
+ T x;
+ T y;
+
+ };
+
+} // math
+} // jin
+
+#endif \ No newline at end of file