Adding Custom Scene Node Problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
qidaozhilong2
Posts: 17
Joined: Sun Apr 01, 2012 3:51 pm

Adding Custom Scene Node Problem

Post by qidaozhilong2 »

My Question is 'What's the differences between two methods of adding new custom scene node as follow'?

[One]
I've added some custom scene nodes on irrlicht, and just 'CxxxSceneNode.cpp and CxxxSceneNode.h'.
It's OK.

[Two]
But, i found some files also related scene node.
'ISceneManager.h'---- can found many addxxxSceneNode()
'CDefaultSceneNodeFactory.cpp'----
case ESNT_xxx:
return Manager->addxxxSceneNode(10, parent);
case ....
'CSceneManager.cpp'---- addxxxSceneNode()
'CSceneManager.h'---- addxxxSceneNode()
'ESceneNodeType.h'----
enum ESCENE_NODE_TYPE
{
//! simple cube scene node
ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
......
qidaozhilong2
Posts: 17
Joined: Sun Apr 01, 2012 3:51 pm

Re: Adding Custom Scene Node Problem

Post by qidaozhilong2 »

Changes these files [Two] mentioned will increase performance or other advantages?
Brainsaw
Posts: 1241
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Adding Custom Scene Node Problem

Post by Brainsaw »

I don't know if you get some performance increase by modifying the scene manager (would imho not be so big anyways, as these changes are only relevant when scene nodes are added), but the "standard" way of adding new scene nodes to the scene manager is to write your own scene node factory and register it to the scene manager (before loading a scene), I never had any bad experience doing it that way (neither in performance nor anything else).
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Post Reply