From 2733324701b0b3e7e9b7a47860dc3aa954ece80e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 30 Aug 2004 18:51:42 +0000 Subject: [PATCH] Fixed the Matrix::get(Quat&) method --- src/osg/Matrix_implementation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/Matrix_implementation.cpp b/src/osg/Matrix_implementation.cpp index 46e8e776d..0bb5708a2 100644 --- a/src/osg/Matrix_implementation.cpp +++ b/src/osg/Matrix_implementation.cpp @@ -125,12 +125,12 @@ void Matrix_implementation::get( Quat& q ) const int nxt[3] = {1, 2, 0}; - tr = _mat[0][0] + _mat[1][1] + _mat[2][2]; + tr = _mat[0][0] + _mat[1][1] + _mat[2][2]+1.0; // check the diagonal if (tr > 0.0) { - s = (value_type)sqrt (tr + 1.0); + s = (value_type)sqrt (tr); QW = s / 2.0; s = 0.5 / s; QX = (_mat[1][2] - _mat[2][1]) * s;