model or node

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
yan007

model or node

Post 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 ?
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post 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.
Bugfree is not a synonym to dumbass-resistant

My irrlicht files and tutorials
My music in mp3
Guest

Post by Guest »

it's "Object Oriented Programming" to be exact (before mis information spreads to the newbies ;)
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

Ooops! Language barrier caused some trouble here! Thanks for correction, but still the principle remains the same, whatever this technique is called.
Bugfree is not a synonym to dumbass-resistant

My irrlicht files and tutorials
My music in mp3
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post 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...
what is this thing...
Post Reply