<div dir="ltr"><div><div><div><div><br></div>I believe your vector has to be storing pointers to the sphere objects, not entire sphere objects themselves. And indeed the same pointer is passed to addChild, as to removeChild afterwards, things *should* work as intended. To make sure, print the pointer values you pass to addChild/removeChild to verify.<br><br></div><div>some background:<br></div>Due to the private destructor of any child of osg::Referenced any such object cannot be put into standard containers. OSG wants to stay in control of object creation and destruction using its internal reference counting system, and hence the destructor cannot be made public or the container class would destroy the object whenever it wants (even when still referenced by the OSG graph).<br><br></div><div>Christian<br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-22 13:52 GMT+02:00 Alvaro Ginestar <span dir="ltr"><<a href="mailto:alvaroginestar@hotmail.com" target="_blank">alvaroginestar@hotmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><div>hi everyone!!</div><div>i try remove a sphere, with "removechild" it doesn't work.</div><div>i use root->addChild(vector[x]); for to add the sphere in a node root and then i try to remove with root->removeChild(vector[x]);</div><div>In the scene is draw a sphere, but it doesn't remove the sphere.</div><div>someone know I'm doing wrong?</div> </div></div>
<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>