Hi Paul,
Yes, i am going
osg::Node* node = hitr->nodePath.back();
if (node && node->getNumParents() > 0)
{
node = node->getParent(0);
...
}
Yes, well no wonder you're always getting the same parent... :-)
now im trying this but its crashing:
What you want to do is walk the path up from the last node in the node path.
for (unsigned int i = nodePath.size() - 1; i >= 0; --i)
{
// check the node
}
or use iterators (you can use rbegin(), rend(), ... - check the STL
documentation).
And as I said, it might not be the first node up from the one you got in
the intersection that will be different, if your model has a multi-level
hierarchy you'll need to go up more than that.
Know your graph... And you can use osgDB::writeNodeFile(*root,
"saved_scene.osg"); to write the whole scene graph to a file and examine
it. It's very useful to know what to expect and how the graph is laid out.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org