[osg-users] How do I continuously read the mouse position as the mouse is moving, without a click event in osg

michael kapelko kornerr at gmail.com
Fri Feb 8 03:11:57 PST 2019


Hi.

Not sure why you "read" it during FRAME events. I personally create a
class that:
* inherits osgGA::GUIEventHandler
* overrides its bool handle(const osgGA::GUIEventAdapter
&eventAdapter, osgGA::GUIActionAdapter &actionAdapter, osg::Object
*object, osg::NodeVisitor *visitor) method

bool handle(...) method is where you get notified of mouse events once
you subscribe that class of yours to osg::Viewer events by using
osg::Viewer's addEventHandler(...) method

For example, here's my Mouse class:
https://github.com/OGStudio/openscenegraph-cross-platform-examples/blob/master/05.NodeSelection/desktop/src/input.h#L84

On Fri, 8 Feb 2019 at 14:03, Kris Bartowski <kpoloczek at vp.pl> wrote:
>
> Hi,
>
> I want to read the mouse location at any time, but unfortunately when i try to read it for example when event type is FRAME, it always gives me the last clicked mouse coordinates.
>
> Thank you!
>
> Cheers,
> Kris
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75598#75598
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list