From b6c6885a9765da99457c94ffe2707c1b697e17f0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 8 Nov 2012 15:28:24 +0000 Subject: [PATCH] Changed the way the mouse position is update to handle the remote device control. --- applications/present3D/present3D.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 85eb43b0e..7a5c693fa 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -133,20 +133,23 @@ class FollowMouseCallback: public osgGA::GUIEventHandler { public: + FollowMouseCallback(): + _mousePostition(0.5,0.5) {} + virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv) { osg::AutoTransform* transform = dynamic_cast(object); if (!transform) return false; + osg::NotifySeverity level = osg::INFO; + switch(ea.getEventType()) { - case(osgGA::GUIEventAdapter::FRAME): - //case(osgGA::GUIEventAdapter::MOVE): - //case(osgGA::GUIEventAdapter::DRAG): - { - osgViewer::View* view = dynamic_cast(&aa); + case(osgGA::GUIEventAdapter::PUSH): + case(osgGA::GUIEventAdapter::RELEASE): + case(osgGA::GUIEventAdapter::MOVE): + case(osgGA::GUIEventAdapter::DRAG): - osg::NotifySeverity level = osg::INFO; osg::notify(level)<