Robert,

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.

Regards,
-Fred

----- Mail original -----
De: "Robert Osfield" <robert.osfi...@gmail.com>
À: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org>
Envoyé: Jeudi 6 Septembre 2012 15:16:01
Objet: Re: [osg-users] Rev 13092 broke osgViewerFLTK

Hi Fredric,

I made the changes to Viewer.cpp w.r.t generation of the frame event
to avoid a bug where the frame event would get the last frames X,Y,
button and key modifier settings rather than the current frames
settings, so I moved the frame generation till later.

I'm guess that the removal of the explict settings of the eventState
InputRange is probably the most likely cause for the difference with
the FLTK viewer rather than just the move of the frame disaptch till
later.

The curious thing is that why doesn't the standard OSG viewer and
other viewers exhibit the same bug as the FLTK one.  Perhaps there is
some difference in how the different viewers set up/pass on the
original window dimensions.  I think the correct fix will probably be
along these lines.

Just reverting the code as you have done will re-introduce a bug so is
not appropriate.

Robert.

On 6 September 2012 14:10, Frederic Bouvier <fredlis...@free.fr> wrote:
> Well, restoring this block at the new frame call location fix the issue :
>
> Index: src/osgViewer/Viewer.cpp
> ===================================================================
> --- src/osgViewer/Viewer.cpp    (revision 13092)
> +++ src/osgViewer/Viewer.cpp    (working copy)
> @@ -797,6 +797,20 @@
>
>          }
>      }
> +
> +    if (_eventQueue.valid())
> +    {
> +        osgGA::GUIEventAdapter* eventState = 
> getEventQueue()->getCurrentEventState();
> +        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() );
>
>
>
>
> Regards,
> -Fred
>
> ----- Mail original -----
> De: "Frederic Bouvier" <fredlis...@free.fr>
> À: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org>
> Envoyé: Jeudi 6 Septembre 2012 14:55:12
> Objet: Re: [osg-users] Rev 13092 broke osgViewerFLTK
>
> Hi Robert,
>
> rev 13092 is a change in osgViewer::Viewer only. Your comment was :
>
> Moved the frame() event into the event traversal after then events and their 
> state have been accumulated.
>
> In the end, this whole block disappeared :
>
>
>     if (_eventQueue.valid())
>     {
>         osgGA::GUIEventAdapter* eventState = 
> getEventQueue()->getCurrentEventState();
>         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() );
>     }
>
>
>
>
>
> Any hint why this block should have to be removed ? Does it means it has to 
> be done at the application level ?
>
> Regards,
> -Fred
>
> ----- Mail original -----
> De: Robert Osfield
>
> Hi Frederic,
>
> I've applied your fix to the CMakeLists.txt and installed FLTK on my
> system and see the error with the camera manipulator.  My guess there
> is scale issue with the window coordinates and probably something is
> missing from the example that should be passing on parameters to
> osgViewer.  I have plenty of others tasks on my plate so I'll defer to
> others for tracking down this issue.
>
> Cheers,
> Robert.
>
> On 6 September 2012 09:27, Frederic Bouvier <fredlis...@free.fr> wrote:
>> Hi Robert,
>>
>> I was reported a problem in fgrun (the flightgear launcher) where camera 
>> manipulation in the aircraft viewer is broken using OSG trunk, on Linux, but 
>> I was able to reproduce it on Windows too. This video explain the problem : 
>> http://youtu.be/xN1hTGte1EM
>>
>> After bisecting, I found that revision 13092 was the culprit. Then I managed 
>> to reproduce the problem using osgViewerFLTK. I had to make this change in 
>> order to generate the makefile BTW :
>>
>>
>> Index: examples/CMakeLists.txt
>> ===================================================================
>> --- examples/CMakeLists.txt     (revision 13092)
>> +++ examples/CMakeLists.txt     (working copy)
>> @@ -216,7 +216,7 @@
>>
>>      ENDIF()
>>
>> -    IF   (FLTK_FOUND AND FT_GL_LIBRARY)
>> +    IF   (FLTK_FOUND AND FLTK_GL_LIBRARY)
>>          ADD_SUBDIRECTORY(osgviewerFLTK)
>>      ENDIF()
>>
>>
>>
>> I compared the behaviour with the one in osgViewerGLUT that works, but 
>> wasn't able to detect a significant difference.
>>
>> Regards,
>> -Fred
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to