diff --git a/include/osgGA/NodeTrackerManipulator b/include/osgGA/NodeTrackerManipulator index 953535887..1c96901a7 100644 --- a/include/osgGA/NodeTrackerManipulator +++ b/include/osgGA/NodeTrackerManipulator @@ -90,6 +90,8 @@ class OSGGA_EXPORT NodeTrackerManipulator : public MatrixManipulator /** Return node if attached.*/ virtual osg::Node* getNode(); + virtual void computeHomePosition(); + /** Move the camera to the default position. May be ignored by manipulators if home functionality is not appropriate.*/ virtual void home(const GUIEventAdapter& ea,GUIActionAdapter& us); diff --git a/src/osgGA/NodeTrackerManipulator.cpp b/src/osgGA/NodeTrackerManipulator.cpp index e34814049..70257b42d 100644 --- a/src/osgGA/NodeTrackerManipulator.cpp +++ b/src/osgGA/NodeTrackerManipulator.cpp @@ -249,6 +249,9 @@ void NodeTrackerManipulator::addMouseEvent(const GUIEventAdapter& ea) void NodeTrackerManipulator::setByMatrix(const osg::Matrixd& matrix) { + osg::Vec3d eye,center,up; + matrix.getLookAt(eye,center,up,_distance); + computePosition(eye,center,up); } void NodeTrackerManipulator::computeNodeWorldToLocal(osg::Matrixd& worldToLocal) const