Page 1 of 1

Adding additional properties to sceneNodes...

Posted: Sun May 30, 2010 11:02 am
by xirtamatrix
Hi folks,

I need to add additonal properties to my sceneNodes. As I'm rather new to all this, I'd apprciate some advice as to what is the standard/best way to do this.

So far I can think of 2 following ways:

1. Use vector arrays for each type of property. When a node is created, push an elemnt into every array to keep array indices match node IDs. Assign the node same ID as the array index. This way we I could always find the right property for the right node.

2. Create seperate class/classes for the additional properties. Match by IDs to find right property for th node. But if to do this, should I derive from ISceneNode or write totally seperate class/classes?

Also, which would be most memory-efficient way?

Thanks in advance for any advice/hints/links.

/regards

Posted: Sun May 30, 2010 12:59 pm
by sudi
well this depends. what do u need your extra data for? is it supposed to be gamelogic or something like that? if yes you are going the wrong route. keep in mind that irrlicht is a render engine and therefor should be USED by your gamelogic not the other way round.
Lets say you have a entity of type monster. this entity will hold all relevant data including the the graphics represantation(irrlicht ISceneNode probably)

Posted: Sun May 30, 2010 3:38 pm
by Seven

Posted: Sun May 30, 2010 4:22 pm
by Virion
if you save those scene nodes in .irr file, you can use serializer to save custom variables in it.

Posted: Mon May 31, 2010 10:55 am
by Tranen
I had the same problem, check this tread:

http://irrlicht.sourceforge.net/phpBB2/ ... highlight=