Hi Frederic,

On 6 September 2012 15:02, Frederic Bouvier <fredlis...@free.fr> wrote:
> I don't revert the code. I moved the setInputRange block where you put 
> _eventQueue->frame( getFrameStamp()->getReferenceTime() );
> What I don't see is if the block removal was intended or worked by accident 
> on most viewer and was unnoticed.

I didn't include the setInputRange code when I refactor the frame
event generation as I thought it was now redundant.  It turns out the
testing I did wasn't quite extensive enough though... when I was
testing out camera manipulator switching this morning I came across a
bug when going from trackball to flight or drive manipulators where
the camera would slide off to the right even without any mouse
movement.  Turns out that it was the same input scale issue and adding
back in the setInputScale fixes it.  I still still think it suggests
something else where isn't setting things correctly, I'll leave this
investigation for another day though.  I've just applied the below
change.

Could you try our svn/trunk and let me know if the FOX example is now
working OK again?

Cheers,
Robert.


$ svn diff
Index: Viewer.cpp
===================================================================
--- Viewer.cpp  (revision 13124)
+++ Viewer.cpp  (working copy)
@@ -798,6 +798,17 @@
         }
     }

+    // pass on the coorindates of the main camera to make sure the
frame event is scaled appropriately.
+    if (getCamera()->getViewport())
+    {
+        osg::Viewport* viewport = getCamera()->getViewport();
+        eventState->setInputRange( viewport->x(), viewport->y(),
viewport->x() + viewport->width(), viewport->y() +
viewport->height());
+    }
+    else
+    {
+        eventState->setInputRange(-1.0, -1.0, 1.0, 1.0);
+    }
+
     _eventQueue->frame( getFrameStamp()->getReferenceTime() );
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to