[osg-users] delete scene osg

2013-03-01 Thread lucie lemonnier
Hi,

I want to delete a complete scene. I use 
root-removeChildren(0,root-getNumChildren());
Does it destroys the objects in the scene?

Thank you!

Cheers,
lucie

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





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


Re: [osg-users] delete scene osg

2013-03-01 Thread Sebastian Messerschmidt

Hi Lucie

Hi,

I want to delete a complete scene. I use 
root-removeChildren(0,root-getNumChildren());
Does it destroys the objects in the scene?
Yes and no. First of all it does exactly what the name says. It removes 
the children from the group.
If you don't reference the nodes below that scene anymore(via 
osg::ref_ptr), they get destroyed (i.e. if their reference count is zero)
A simpler approach is to do: root = new osg::Group(), which will also 
detach all children and is less pain ;-)


As you are speaking of the scene, you probably should consider simply 
setting the viewers scenedata to an empty group:


viewer.setSceneData(new osg::Group());

cheers
Sebastian


Thank you!

Cheers,
lucie

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





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


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