My main View class (extending osgViewer::View indirectly) uses a custom ordering to determine how objects in the scene are selected when a user e.g. clicks a mouse button. I'm using one of the osg Draggers in a scene, and in its handle method it invokes View::computeIntersections to determine which node was clicked first, but this does not always agree with the custom selection routine. As a result, clicking on the dragger when it is behind an object with a lower-priority selection order does not select the dragger and so does not work as intended.

My first thought was to override the base View::computeIntersections method to reflect the custom logic elsewhere in the View class, but it is a non-virtual method. Is there a particular reason this is so? As a work-around, I overrode the handle method in the dragger, copied most of the code from the original implementation, and changed the selection order there to reflect the custom View logic, but this feels like an ugly solution. Is there a better way of approaching a universal implementation of a custom selection order, or can View::computeIntersections be marked virtual?

I'm using osg version 2.9.7, but I see the method is still non-virtual in the 3.3.0 branch.

Thanks!

--
Clay Alberty
Stellar Science
443-550-1151


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

Reply via email to