User Data in Node

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
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

User Data in Node

Post by mistral »

Hi,

Did I read somewhere that you can store data in a scene node? Or was that only for xml save / load?


Thanks
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: User Data in Node

Post by REDDemon »

You can do that in many ways. Even if there was a "userdata" method, you should avoid using it like garlic (what if later you need further data but the node stores only 1 data)?

In example you could create a class that has your scenenode stored as a pointer and inherit from ISceneNode, then forward all ISceneNode methods by calling the ones on the pointer..

It all depends on what you are trying to achieve and how is pre-existing code. And what data you need (custom data? or just load/save ability for existing nodes?)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
mistral
Posts: 14
Joined: Mon Jan 23, 2017 9:35 am

Re: User Data in Node

Post by mistral »

That's sort of what I've done, have an Obj class with pointer(s), etc...

Thanks
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: User Data in Node

Post by Mel »

It is better to have a scene node among your data, in your own class :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply