Hi, Paul.
What I really want to do is to be able to deal with the instance of
the class created by me, which has a drawable part that is selectes on the
screen. All the methods return the parents in the form of osg::Node, but
what I want is to be able to deal with that instance of the class I've
created that has its drawable part on the screen. You see? I click on the
drawable, but I get the class instance attached to it. Here's what I've
tried to do, but some major error occured and my application stopped
working:
if(hitr->drawable.valid())
{
osg::ShapeDrawable* shapedrawable =
dynamic_cast<osg::ShapeDrawable*>(hitr->drawable.get());
changeColor(shapedrawable);
MyClass* myclass =
dynamic_cast<MyClass*>(shapedrawable->getParent(1));/* maybe the problem is
this number. I was looking for the second parent from the root (including
the root that I assumed it was 0). Is it how it's done? */
myclass->printPosition(); // there's is an
osg::Vec3f that stores the position of an instance of the class MyClass
}
Thanks,
Renan M Z Mendes
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org