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

Robert Osfield robert.osfield at gmail.com
Sat Feb 9 03:10:29 PST 2019


Hi Kris,

On Fri, 8 Feb 2019 at 12:46, Kris Bartowski <kpoloczek at vp.pl> wrote:
> I read it during frame events, becouse i tought that maybe every frame the current mouse position is updated.

The OSG source code is a resource that you can use to answer all the
questions you might have, so I would recommend just getting to know
the code base and the underpinnings on classes like
osgGA::GUIEventAdapter.

The OSG doesn't poll the mouse x,y position each new frame, it only
tracks mouse position though the osgGA::GUIEventAdapter objects
generated by mouse move, mouse drag and mouse press/release events.
The mouse position is cached and passed on to new non mouse events for
your convenience.

Robert.


More information about the osg-users mailing list