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
Adding additional properties to sceneNodes...
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
Adding additional properties to sceneNodes...
to live, is natural; to die, is not!
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)
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.
if you save those scene nodes in .irr file, you can use serializer to save custom variables in it.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info