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."
This commit is contained in:
Robert Osfield
2008-10-21 16:31:01 +00:00
parent 144e44a749
commit 3b5f9f1e5d

View File

@@ -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