[Feature Request]Add user data to the ISceneNode interface

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Locked
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

[Feature Request]Add user data to the ISceneNode interface

Post by Darktib »

Hello,

I propose a functionnality which -I think- can be very useful : adding a pointer to a user data (logically a void*) so that if you want to link an IScenenode to a class you have created you just have to pass a pointer and don't have to recompile the engine.

For example : you have a class Entity which contains an IScenenode (this class does not derive from ISceneNode, because the contained scene node can be an IAnimatedMeshSceneNode, a ITerrainSceneNode, etc...) and you want to retrieve this class by using picking commands, like getSceneNodeFromScreenCoordinates(). This function returns an ISceneNode, and actually if you want to retrieve the linked Entity, you have to modify the engine...

With these function:

Code: Select all

void setUserData(void* data);
void* getUserData();
you can pass anything which can be useful for the user with a maximum of convenience.

The patch needed for that is not very hard to do, I could make it if you want, but first I wanted to have your opinion.

So , what do you think about this feature ? (agree, disagree, etc...)
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Locking purely to avoid clutter. Please feel free to bump the previous discussion though.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Locked