Rom
26-01-2006 11:48:29
Hi everybody,
I'm trying to iterate over all the node and the entities of my scene.
I've written a recursive method :
But it crashes when I do the cast from Node to SceneNode.
Can someone tell me how to solve that ?
Thanks
I'm trying to iterate over all the node and the entities of my scene.
I've written a recursive method :
void printNodeContent(SceneNode s) {
Console.WriteLine("Node n.0 : " + s.GetName());
if (s.NumChildren() == 0)
{
for (ushort i = 0; i < s.NumAttachedObjects(); i++)
{
Console.WriteLine(" Attached Object n." + i + " : " + s.GetAttachedObject(i).GetName());
}
}
else {
for (ushort i = 0; i < s.NumChildren(); i++)
{
printNodeContent((SceneNode)(s.GetChild(i)));
}
}
}
But it crashes when I do the cast from Node to SceneNode.
Can someone tell me how to solve that ?
Thanks