Hi Martin,

You can't reuse (osgGA::GUIEventAdapter::DRAG) case in handle() because the scroll event needs to be cleared.

That's how we do it, and I didn't see any problems... Our code is quite close to:

    case (osgGA::GUIEventAdapter::SCROLL):
    case (osgGA::GUIEventAdapter::DRAG):
    {
        addMouseEvent(ea);
        if (calcMovement()) aa.requestRedraw();
        aa.requestContinuousUpdate(false);
        _thrown = false;
        return true;
    }

and it works great. Perhaps there's something else that is different. We've subclassed TrackballManipulator and replaced most of its functionality with similar (but not quite identical) code...

I like the idea of reusing the drag and 'dy' - I have rewritten it with that 
approach. It does lead to having to declare a couple of variables before they 
can be set which seems to be against OSG house style (and is generally a bad 
idea)

It's not that bad, since you only have an if and an else it can't really fall through the cracks. As with any programming convention I tend to be pragmatic...

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to