Bug in RTTPicker

classic Classic list List threaded Threaded
3 messages Options
Nikkitta Nikkitta
Reply | Threaded
Open this post in threaded view
|

Bug in RTTPicker

Hi,
Currently we are building an application based on osgEarth with QML gui.

To integrate osgEarth in QML we created our class, which inherits QQuickItem.
Inside it we use the following rows to update paint node on resize events.
osgViewer::GraphicsWindow->resized()
...
( *currentCamera )->setViewport( new osg::Viewport( (int)geometry.x(), (int)geometry.y(),
                (int)geometry.width(), (int)geometry.height() ) );

The bug that we found in RTTPicker is connected to resize event.
After any resize RTTPicker stops working properly, it always returns onMiss() method.

As far as we understood the initial image to calculate intersections in RTTPicker has size of 256.
While doing resize this image is forced to take the form of viewport (it is also resized).
This happens somewhere inside OSG, because it is set to FRAME_BUFFER_OBJECT.

For our solution we changed line 243 in RTTPicker.cpp:
    //c._pickCamera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT );
    c._pickCamera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER );

It works for us, but we are not sure that it should be done this way.

I guess this image in RTTPicker shouldn't be resized at all and it always should be 256.

Does anybody have explanations for this?
Best regards,
Nikita Petrov
Buks van Ellewee Buks van Ellewee
Reply | Threaded
Open this post in threaded view
|

Re: Bug in RTTPicker

Yes, I encountered the same problem and had to call resize(...) on the RTTPicker camera in my Resize event to keep the picker working after a window resize.  This is probably not ideal either.
Regards, Buks
DizL DizL
Reply | Threaded
Open this post in threaded view
|

Re: Bug in RTTPicker