diff --git a/vcg/math/matrix44.h b/vcg/math/matrix44.h index a7ccc70f..5596a6bb 100644 --- a/vcg/math/matrix44.h +++ b/vcg/math/matrix44.h @@ -780,10 +780,18 @@ template Matrix44 &Transpose(Matrix44 &m) { return m; } +/* + To invert a matrix you can + either invert the matrix inplace calling + + vcg::Invert(yourMatrix); + + or get the inverse matrix of a given matrix without touching it: - - -template Matrix44 &Invert(Matrix44 &m) { + invertedMatrix = vcg::Inverse(untouchedMatrix); + +*/ +template Matrix44 & Invert(Matrix44 &m) { LinearSolve solve(m); for(int j = 0; j < 4; j++) { //Find inverse by columns. @@ -793,7 +801,6 @@ template Matrix44 &Invert(Matrix44 &m) { for(int i = 0; i < 4; i++) m.ElementAt(i, j) = col[i]; } - return m; } template Matrix44 Inverse(const Matrix44 &m) {