Hi there:
When I read the program osgKeyboardMouse, I got a question. The following is
parts of the codes when clicking the object in that program:
osg::Node* node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0;
osg::Group* parent =
(nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0;
MyClass* pMyPointer = dynamic_cast <MyClass *> (parent);
if (!pMypointer)
{
MyClass* pAnotherPointer = new MyClass;
pAnotherPointer->addChild(node);
parent->replace(node, pAnotherPointer);
}
else
{........}
if I use parent->addChild(pAnotherPointer) to take the place of
parent->replace(node, pAnotherPointer), why the pointer pMyPointer is still
null when clicking the object again?
Thank you.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/