Hi Robert,
Robert Osfield wrote:
Hi Vincent,
On Tue, Oct 6, 2009 at 5:19 PM, Vincent Gadoury <[email protected]> wrote:
It seems there is a glitch with the new osgManipulator event handling and
the TrackballManipulator. In the osgmanipulator example, if you keep ctrl or
'a' pressed when you rotate the trackball using the left mouse button, the
trackball might get crazy (rotating of arbitrary - probably high - angle).
The trick to reproduce the bug is to try to release the mouse button on a
dragger. I'm able to reproduce it constantly. I was never able to reproduce
it when the ctrl or 'a' key were not pressed. I tested it on revisions 10593
and 10606.
Could you have a bash at tracking it down as I can't track down
something I can't reproduce.
I've done a little investigation and it is not directly related to
osgManipulator, although the TabBoxDragger seems to create the perfect
"environnemnt" to reproduce it (at least on my machine).
The problem is that sometimes two mouse-dragging events are sent to the
TrackballManipulator with a very little time difference. It might be
system specific (I'm on Windows Vista 64-bit). If you happen to release
the mouse button just after these events, the trackball's throwScale
value will become huge (around 100 instead of around 1) and the
trackball will start spinning "randomly" or zoom to great distances.
I tracked the occurrence of these events by outputting the time
difference on drag events in TrackballManipulator.cpp with something like:
[code]
static double lastDragTime = ea.getTime();
osg::notify(osg::NOTICE)<<"dt: "<<ea.getTime() - lastDragTime<<std::endl;
lastDragTime = ea.getTime();
[/code]
I usually get time differences between 0.02 and 0.005, both with a key
pressed or not.
But in osgManipulator with a TabBoxDragger (or TabBoxTrackballDragger)
in the scene, I start getting sparse events with a dt < 0.0002. And if I
keep any key pressed, I get these reading regularly about every second,
which might be related to key repeating. It helps if you move the mouse
quickly.
I was also able to reproduce the glitch in osgteapot, where I get a few
events with a dt around 7e-5, usually following dt > 0.01. It seems
unrelated to key state.
Unfortunately, that's as deep as I can investigate.
And I'm sorry about hijacking this topic with a not-so-related bug.
Using the new osgManipulator with ctrl pressed was the first way I found
to reproduce the glitch.
regards,
Vincent Gadoury
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org