Problems converting SceneNode into its correct type

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Eldritch
Posts: 33
Joined: Mon Feb 26, 2007 12:33 pm

Problems converting SceneNode into its correct type

Post by Eldritch »

When I traverse the SceneManager's scene graph, I cannot seem to convert the children to their respective types.

What I mean is:

Code: Select all

SceneNode[] children = smgr.RootSceneNode;
foreach (SceneNode child in children)
    if (child.SceneNodeType.ToString.Equals("Mesh"))
    {
         AnimatedMeshSceneNode mesh = (AnimatedMeshSceneNode)child;
    }
It crashes when I try to convert the node to an animated mesh scene node, giving me an error that the conversion is not possible. This really makes me think that someone forgot to inherit from something... :roll:
Locked