Page 1 of 1

model or node

Posted: Sun Oct 30, 2005 12:12 pm
by yan007
hi,
in the examples from irrlicht there are two methods used:
IAnimatedMeshSceneNode and ISceneNode
i have two questions:
- why is it necessary to create a node from a IAnimatedMesh, cant you
work without that
- whats the difference between a IAnimatedMeshSceneNode and a
ISceneNode, just the animated part or is there more ?

Posted: Sun Oct 30, 2005 1:46 pm
by CZestmyr
This will be a bit longer explanation, it took me a while as well, when I was beginning with Irrlicht, but when I got into it, I found out that I've learnt quite a lot about Objective Oriented Programming (OOP) during the process.

So - I will presume that you know a bit about class inheritance and polymorphism in OOP. (If you don't: the former means, that you can have a class, which is derivated from or inherits the members of another class, the latter means that you can use the derived class, whenever a base class is needed)

Irrlicht is very logical, which is a must in such a huge project, I think. You have the SceneManager class, which takes care of all the objects in the virtual Irrlicht world. But the point is, that it uses SceneNode classes (better said, ISceneNode interface) in the process, so how would you possibly tell it to handle a mesh object? It is simple - there is a class, which can contain this mesh object and is also derived from the ISceneNode interface, hence can be handled by the the SceneManager - voilá: here comes the IAnimatedMeshSceneNode!

So the answer to your first question is: Because the Scene Manager can work with scene nodes only
And the second: I would call it a slight enhancement of features rather than a difference, because that's just what the IAnimatedMeshSceneNode does - it enhances the possibilities of the ISceneNode, so that it can view meshes.

Posted: Sun Oct 30, 2005 9:52 pm
by Guest
it's "Object Oriented Programming" to be exact (before mis information spreads to the newbies ;)

Posted: Mon Oct 31, 2005 7:52 pm
by CZestmyr
Ooops! Language barrier caused some trouble here! Thanks for correction, but still the principle remains the same, whatever this technique is called.

Posted: Thu Nov 03, 2005 10:18 pm
by needforhint
I found it like IAnimatedMeshSceneNode class differs from ISceneNode the way that ISceneNode can be really a node of anything and IAnimatedMeshSceneNode is a node that handles a mesh, which can be animated, if it isn't then it holds frame 0, therefor the IMeshSceneNode doesn't exist...there is also ILightSceneNode and other node classes like IParticleSystemSceneNode derived from SceneNode class...