From 285ba9c83fc5db28c79e9fd6a8924f502fcfd392 Mon Sep 17 00:00:00 2001 From: iasonmanolas Date: Fri, 8 Apr 2022 11:48:25 +0300 Subject: [PATCH] Forward declared Transpose function since it was used before declared within the Matrix44 class --- vcg/math/matrix44.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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));