Adding additional properties to sceneNodes...

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
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Adding additional properties to sceneNodes...

Post 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
to live, is natural; to die, is not!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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)
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

if you save those scene nodes in .irr file, you can use serializer to save custom variables in it.
Tranen
Posts: 34
Joined: Mon May 05, 2008 5:43 pm

Post by Tranen »

I had the same problem, check this tread:

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