diff --git a/include/Geometry/vector_gen.h b/include/Geometry/vector_gen.h index 8ebed15b0b16273d6d6fd0b3636a32405263f982..d1b1e11d96e21f847737e950d249515f120eb656 100644 --- a/include/Geometry/vector_gen.h +++ b/include/Geometry/vector_gen.h @@ -117,7 +117,11 @@ public: Vector operator-() const ; - Vector operator*(T a) const ; + Vector operator*(T a) const ; + +// template +// Vector operator*(T2 a) const ; + Vector operator/(T a) const ; @@ -208,8 +212,8 @@ bool isNull(T x, int precision = 0) ; template bool isNull2(T x, int precision = 0) ; -template -Vector operator*(T a, const Vector& v) ; +// template +// Vector operator*(T a, const Vector& v) ; template Vector operator/(T a, const Vector& v) ; @@ -222,6 +226,9 @@ T tripleProduct(const Vector& v1, const Vector& v2, const Vector template Vector slerp(const Vector &v1, const Vector &v2, const T &t) ; +template +Vector operator*(T2 b, const Vector& v); + /**********************************************/ /* SOME USEFUL TYPEDEFS */ diff --git a/include/Geometry/vector_gen.hpp b/include/Geometry/vector_gen.hpp index bb6dbc5a79e3cf40c0cfbbbb492408bc96aac3d3..036029fc704c0c8cef62a1631cc9ea0b8a277409 100644 --- a/include/Geometry/vector_gen.hpp +++ b/include/Geometry/vector_gen.hpp @@ -405,12 +405,13 @@ inline bool isNull2(T x, int precision) return (isNull(x, - (precision * precision))) ; } -template -inline Vector operator*(T a, const Vector& v) +template +inline Vector operator*(T2 b, const Vector& v) { - return v * a ; + return v * T(b) ; } + template inline Vector operator/(T a, const Vector& v) {