How to use custom ISceneNodeFactory

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
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

How to use custom ISceneNodeFactory

Post by Thulsa Doom »

I used to design my custom classes
by aggregating pointers to SceneNodes and other objects (physics, network usw).
But this implies at least overhead in handling access right to the different objects and managing the classes itself.

A more speedy way would be just to inherit
from the build in classes and to overwrite the methods needed,
as this allows polymorphism. Also the SceneManager is
designed for tasks in managing SceneNodes and there would be no overhead.

Therefore it would be of advantage to use the Irrlicht
SceneManager to create my custom nodes.

I noticed that latest Irrlicht releases support now a method:
ISceneManager::registerSceneNodeFactory (ISceneNodeFactory* factoryToAdd)
The only thread I found dealing with this topic is:
http://irrlicht.sourceforge.net/phpBB2/ ... odefactory
but it did not help so much.
Does someone has experience how to use this feature and can help me out?
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Take a look at the Irrlicht source (CDefaultSceneNodeFactory.h/cpp).

If you want a specific example, look at the example plugins found within the irredit package. (Think they're outdated regarding changed datatypes etc. but they should give you a good hint on how to do it.)

How to use it once your own factory class is created - look at your own link.
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

Post by Thulsa Doom »

Cool, thx Ico!
Quick post - prompt answer!
I think the use of the MAKE_IRR_ID Macro that
I've found in "ExampleSceneNodePlugin.cpp" from the irredit package solves my problem!
Post Reply