From 038eb8d75e61c73786100dce649832e8dbff1be3 Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Fri, 8 Feb 2013 17:18:36 +0100 Subject: [PATCH] resolve pb of x*V with vector_gen --- include/Geometry/vector_gen.h | 13 ++++++++++--- include/Geometry/vector_gen.hpp | 7 ++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/Geometry/vector_gen.h b/include/Geometry/vector_gen.h index 8ebed15b0..d1b1e11d9 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 bb6dbc5a7..036029fc7 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) { -- GitLab