Hi Roland and JP,

Of course... I forgot to mention that what I want is much structured than the 
well-known userdata. It's a bit as if the "userdata" was a simple "void *" 
(yes, that's a bit exaggerated)... I think Components are a more sophisticated 
system, yet very flexible. Did you have time to read the article I mentionned? 
It's very interesting.

Anyway, I could add my "ComponentContainer" object as a userdata to avoid being 
too intrusive in OSG code, of course.

Please share yor thoughts. And thanks for the answers.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- Mail Original -----
De: "Roland Smeenk" <[email protected]>
À: [email protected]
Envoyé: Jeudi 13 Août 2009 14h20:12 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: Re: [osg-users] Suggestion: Add components in nodes (aggregation)

This is typically done by adding userdata, which happens to be supported by 
each osg:Object (including nodes) in OpenSceneGraph. 

>From source in osg::Object


Code:
        /**
         * Set user data, data must be subclassed from Referenced to allow
         * automatic memory handling.  If your own data isn't directly 
         * subclassed from Referenced then create an adapter object
         * which points to your own object and handles the memory addressing.
         */
        inline void setUserData(Referenced* obj) { _userData = obj; }
        
        /** Get user data.*/
        inline Referenced* getUserData() { return _userData.get(); }
        
        /** Get const user data.*/
        inline const Referenced* getUserData() const { return _userData.get(); }




regards,

Roland Smeenk

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16180#16180





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to