How to find the top nodes in a scene using C# in dotnet


26-06-2006 23:54:55

I want to find the top nodes in a scene using C# in dotnet. It seemed easy but I've been running into alot of undefined functions and structures so I'm not sure I'm on the right track.
The different ways I've tried doing this are below. The comment indicates the problem.

// using a map of the objects

MovableObjectMap map = render.sceneManager.GetMovableObjectMap ("", ""); // GetMovableObjectMap not defined

// iterating the nodes of the root

ObjectIterator iterator = node.getAttachedObjectIterator (); // ObjectIterator, getAttachedObjectIterator not defined in SceneNode

// iterating the nodes supplied by sceneManager

MovableObjectIterator entityIterator = render.sceneManager.GetMovableObjectIterator ("SceneNode"); // MovableObjectIterator not defined


27-06-2006 05:33:29

Last I looked, getting a list of children objects was impossible. So, what I did was maintain my own list of each movable object assigned to a node in a Dictionary<ScenNode, MovableObject>. This is probably not the ideal solution, but it works and I've moved on :)

Of course, you have to ensure that whenever you add something to the scene, you also add it to the map.