Retrieving scene node count

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
VeRtEX
Posts: 4
Joined: Tue Aug 13, 2013 3:52 pm
Location: Stuttgart, Germany

Retrieving scene node count

Post by VeRtEX »

Hi,

i was wondering if there is a way to get a total scene node count from the scene manager or something? Or is managing the nodes up to the user?

I am asking as i want to implement some kind of level switching and i want to remove all nodes, particle systems, meshes and textures etc. from the current scene before loading the new one and haven't found out yet how to get access to these....and before managing myself i thought to better ask here first :).

Thanks in advance.

Cheers,
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Retrieving scene node count

Post by greenya »

The is no method to get count of scene nodes. And i don't see the point of it, maybe only for statistics.

To calc node count you can go though all child nodes of the root node of scene manager, and then go to their child nodes and so on.
I suggest you to add nodes by layers, so you create so empty node, add to its children some logical group of nodes. Then as you know you can move them at once by moving its the parent, you can control visibility of the group in the same way. And you can remove all this group simply be removing the parent.

Meshes and textures has own managers.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Retrieving scene node count

Post by hendu »

The scene manager does have a clear call to remove all nodes; so do the mesh and texture caches.
VeRtEX
Posts: 4
Joined: Tue Aug 13, 2013 3:52 pm
Location: Stuttgart, Germany

Re: Retrieving scene node count

Post by VeRtEX »

Thanks a lot for your replies!

That perfectly helps and works :).
Post Reply