Hi,

I have a problem with picking a dragger when an AutoTransform is active. In fact, the problem occurs with any LineSegmentIntersection with objects inside an AutoTransform. I can resume my case to using the osgManipulator::TrackballDragger with useAutoTransform=true.

Basically, I create a TrackballDragger and add it as a child of the root node (just to test), then run an intersection test when I click (as in the osgManipulator example):

view->computeIntersections(ea.getX(),ea.getY(),intersections)

If I create the Trackball with useAutoTransform=false, everything works fine, it gets intersected and highlights. But if I create the trackball with useAutoTransform=true, it never intersects. In fact, IntersectionVisitor::apply(osg::Transform& transform) is never called. The trackball displays correctly.

I've tested with a really basic application (based on the osgManipulator example) and it works fine:
int main()
{
   osgViewer::Viewer viewer;
   osg::ref_ptr<osg::Group> loadedModel = new osg::Group;

osg::ref_ptr<osgManipulator::TrackballDragger> dragger = new osgManipulator::TrackballDragger(true);
   dragger->setupDefaultGeometry();
   loadedModel->addChild(dragger);

   viewer.setSceneData(loadedModel.get());
viewer.addEventHandler(new PickModeHandler()); // From osgmanipulator example.

   return viewer.run();
}

My application does about the same thing (except being more complex of course). So obviously I'm missing something in my application, or doing something wrong. And I can't catch what it is.

Does somebody have a clue about what can make an intersection test not work with an auto-transformed object? I understand that it's hard to tell without seeing the specific application's code, but to me the application is quite straightforward.

I'm currently using OSG version 2.9.2.

regards,

Vincent Gadoury
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to