Commit 038eb8d7 authored by Sylvain Thery's avatar Sylvain Thery

resolve pb of x*V with vector_gen

parent aff22ee0
...@@ -117,7 +117,11 @@ public: ...@@ -117,7 +117,11 @@ public:
Vector<DIM, T> operator-() const ; Vector<DIM, T> operator-() const ;
Vector<DIM, T> operator*(T a) const ; Vector<DIM, T> operator*(T a) const ;
// template <typename T2>
// Vector<DIM, T> operator*(T2 a) const ;
Vector<DIM, T> operator/(T a) const ; Vector<DIM, T> operator/(T a) const ;
...@@ -208,8 +212,8 @@ bool isNull(T x, int precision = 0) ; ...@@ -208,8 +212,8 @@ bool isNull(T x, int precision = 0) ;
template <typename T> template <typename T>
bool isNull2(T x, int precision = 0) ; bool isNull2(T x, int precision = 0) ;
template <unsigned int DIM, typename T> // template <unsigned int DIM, typename T>
Vector<DIM, T> operator*(T a, const Vector<DIM, T>& v) ; // Vector<DIM, T> operator*(T a, const Vector<DIM, T>& v) ;
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
Vector<DIM, T> operator/(T a, const Vector<DIM, T>& v) ; Vector<DIM, T> operator/(T a, const Vector<DIM, T>& v) ;
...@@ -222,6 +226,9 @@ T tripleProduct(const Vector<DIM, T>& v1, const Vector<DIM, T>& v2, const Vector ...@@ -222,6 +226,9 @@ T tripleProduct(const Vector<DIM, T>& v1, const Vector<DIM, T>& v2, const Vector
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
Vector<DIM, T> slerp(const Vector<DIM, T> &v1, const Vector<DIM, T> &v2, const T &t) ; Vector<DIM, T> slerp(const Vector<DIM, T> &v1, const Vector<DIM, T> &v2, const T &t) ;
template <unsigned int DIM, typename T, typename T2>
Vector<DIM, T> operator*(T2 b, const Vector<DIM, T>& v);
/**********************************************/ /**********************************************/
/* SOME USEFUL TYPEDEFS */ /* SOME USEFUL TYPEDEFS */
......
...@@ -405,12 +405,13 @@ inline bool isNull2(T x, int precision) ...@@ -405,12 +405,13 @@ inline bool isNull2(T x, int precision)
return (isNull(x, - (precision * precision))) ; return (isNull(x, - (precision * precision))) ;
} }
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T, typename T2>
inline Vector<DIM, T> operator*(T a, const Vector<DIM, T>& v) inline Vector<DIM, T> operator*(T2 b, const Vector<DIM, T>& v)
{ {
return v * a ; return v * T(b) ;
} }
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
inline Vector<DIM, T> operator/(T a, const Vector<DIM, T>& v) inline Vector<DIM, T> operator/(T a, const Vector<DIM, T>& v)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment