Re: [osg-users] what's wrong with removechild

2015-07-25 Thread Jannik Heller
Looks like you aren't showing us the whole code. I don't see a removeChild in 
the attached file.

In general, when removing a node you need to remove it as child of its 
particular parent(s) (which is not necessarily the root node).


Code:

while (node-getNumParents())
node-getParent(0)-removeChild(node);




[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64473#64473





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] what's wrong with removechild

2015-07-24 Thread LUO Jianguo
Hi,

I want to pick one node using mouse. then the node deleted. but I failed. I 
don't know why. the nodepick.h attached.

the osg::Node* pNode can be picked. and it can be changed to red.

but the following mViewer-getSceneData()-asGroup()-removeChild(pNode); 
failed. 

I also used m_Rt-removeChild(pNode); failed again. 

So puzzled. help me plz.


Thank you!

Cheers,
LUO

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64470#64470




Attachments: 
http://forum.openscenegraph.org//files/nodepick_135.h


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org