Updates to NodeTrackerManipulator.cpp

This commit is contained in:
Robert Osfield 2004-10-14 20:35:55 +00:00
parent e4f22c72bd
commit bb7c423849
2 changed files with 5 additions and 0 deletions

View File

@ -90,6 +90,8 @@ class OSGGA_EXPORT NodeTrackerManipulator : public MatrixManipulator
/** Return node if attached.*/ /** Return node if attached.*/
virtual osg::Node* getNode(); virtual osg::Node* getNode();
virtual void computeHomePosition();
/** Move the camera to the default position. /** Move the camera to the default position.
May be ignored by manipulators if home functionality is not appropriate.*/ May be ignored by manipulators if home functionality is not appropriate.*/
virtual void home(const GUIEventAdapter& ea,GUIActionAdapter& us); virtual void home(const GUIEventAdapter& ea,GUIActionAdapter& us);

View File

@ -249,6 +249,9 @@ void NodeTrackerManipulator::addMouseEvent(const GUIEventAdapter& ea)
void NodeTrackerManipulator::setByMatrix(const osg::Matrixd& matrix) 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 void NodeTrackerManipulator::computeNodeWorldToLocal(osg::Matrixd& worldToLocal) const