diff --git a/vcg/math/matrix44.h b/vcg/math/matrix44.h index 9bcc0e304..43ed02276 100644 --- a/vcg/math/matrix44.h +++ b/vcg/math/matrix44.h @@ -70,6 +70,9 @@ for 'column' vectors. */ +template class Matrix44; +template Matrix44 &Transpose(Matrix44 &m); + /** This class represent a 4x4 matrix. T is the kind of element in the matrix. */ template class Matrix44 { @@ -242,8 +245,6 @@ template class Matrix44 { ///Premultiply template Point3 operator*(const Matrix44 &m, const Point3 &p); - -template Matrix44 &Transpose(Matrix44 &m); //return NULL matrix if not invertible template Matrix44 Inverse(const Matrix44 &m); @@ -661,7 +662,9 @@ template Point3 operator*(const Matrix44 &m, const Point3 &p) return s; } -template Matrix44 &Transpose(Matrix44 &m) { +template +Matrix44 &Transpose(Matrix44 &m) +{ for(int i = 1; i < 4; i++) for(int j = 0; j < i; j++) { std::swap(m.ElementAt(i, j), m.ElementAt(j, i));