#ifndef MATH_VECTOR_H_
#define MATH_VECTOR_H_
+#include "Fixed.h"
+
#include <cmath>
#include <limits>
#include <ostream>
Vector() : x(0), y(0) { }
Vector(Scalar x, Scalar y) : x(x), y(y) { }
template<class T>
- Vector(const Vector<T> &other) : x(other.X()), y(other.Y()) { };
+ Vector(const Vector<T> &other) : x(other.X()), y(other.Y()) { }
template<class T>
Vector(T x, T y) : x(x), y(y) { }
inline Vector<T> operator *(const Vector<T> &v1, const Vector<T> &v2) {
return Vector<T>(v1.X() * v2.X(), v1.Y() * v2.Y());
}
-template<class T>
-inline Vector<T> operator *(const Vector<T> &v, T s) {
+template<class T, class U>
+inline Vector<T> operator *(const Vector<T> &v, U s) {
return Vector<T>(v.X() * s, v.Y() * s);
}
template<class T>
}
+template<Uint8 i>
+Vector<int> ToInt(const Vector<Fixed<i> > &v) {
+ return Vector<int>(v.X().Int(), v.Y().Int());
+}
+template<Uint8 i>
+Vector<Fixed<i> > ToFixed(const Vector<int> &v) {
+ return Vector<Fixed<i> >(v.X(), v.Y());
+}
+
+
}
-#endif /* GEOMETRY_VECTOR_H_ */
+#endif