From ed0f780321771fcc1fb36ec7745f9698626406da Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Mon, 4 Apr 2005 18:07:27 +0000 Subject: [PATCH] Removed annoying "Can't find the ground" message --- src/osgGA/UFOManipulator.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/osgGA/UFOManipulator.cpp b/src/osgGA/UFOManipulator.cpp index 5ff9bb94f..0d4dda70c 100644 --- a/src/osgGA/UFOManipulator.cpp +++ b/src/osgGA/UFOManipulator.cpp @@ -70,17 +70,31 @@ void UFOManipulator::setByMatrix( const osg::Matrixd &mat ) { _inverseMatrix = mat; _matrix.invert( _inverseMatrix ); + + _position.set( _inverseMatrix(3,0), _inverseMatrix(3,1), _inverseMatrix(3,2 )); + osg::Matrix R(_inverseMatrix); + R(3,0) = R(3,1) = R(3,2) = 0.0; + _direction = osg::Vec3(0,0,-1) * R; // yep. + + _stop(); } void UFOManipulator::setByInverseMatrix( const osg::Matrixd &invmat) { _matrix = invmat; _inverseMatrix.invert( _matrix ); + + _position.set( _inverseMatrix(3,0), _inverseMatrix(3,1), _inverseMatrix(3,2 )); + osg::Matrix R(_inverseMatrix); + R(3,0) = R(3,1) = R(3,2) = 0.0; + _direction = osg::Vec3(0,0,-1) * R; // yep. + + _stop(); } osg::Matrixd UFOManipulator::getMatrix() const { - return (_offset * _matrix); + return (_offset * _matrix); } osg::Matrixd UFOManipulator::getInverseMatrix() const @@ -136,7 +150,7 @@ void UFOManipulator::computeHomePosition() } else { - osg::notify(osg::INFO)<<"UFOManipulator : I can't find the ground!"<