From 3b5f9f1e5d5da76b70a6f3011e880510c2da76dd Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Oct 2008 16:31:01 +0000 Subject: [PATCH] From Chris Denham, "However, just spotted another inconsistency between UFOManipulator::getMatrix() and UFOManipulator::getInverseMatrix() It assumes that inverse(_inverseMatrix * _offset) = _offset * _matrix This is only true when _offset=identity, so I think it should be inverse(_offset) * _matrix This inconsistency can cause problems when switching from UFO to other manipulators, because the UFO:Manipulator::getMatrix function is not necessarily returning a correct inverse of the currently set ModelViewTransform. It was tempting to change the name of the _offset member to _inverseOffset, or to maintain both variables, but in the end went for the minimal change." --- src/osgGA/UFOManipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgGA/UFOManipulator.cpp b/src/osgGA/UFOManipulator.cpp index 5f1877088..49e0aea5f 100644 --- a/src/osgGA/UFOManipulator.cpp +++ b/src/osgGA/UFOManipulator.cpp @@ -132,7 +132,7 @@ void UFOManipulator::setByInverseMatrix( const osg::Matrixd &invmat) osg::Matrixd UFOManipulator::getMatrix() const { - return (_offset * _matrix); + return (osg::Matrix::inverse(_offset) * _matrix); } osg::Matrixd UFOManipulator::getInverseMatrix() const