Hi Barry,

This is a C++ question.

osg::ref_ptr<osgText::Text>  theText = hitr->drawable.get();

should be

osg::ref_ptr<osgText::Text> theText = dynamic_cast<osgText::Text*>(hitr->drawable.get());

Then you should test theText.valid() to make sure it was really an osgText::Text object and not some other type of drawable. dynamic_cast<> uses RTTI to cast a base class object to a derived class, and returns 0 (NULL) if the cast was not possible.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to