>

> So the material map would become

>

>     std::map< osg::StateSet, domMaterial *, BlackMagic > materialMap;

>

> where BlackMagic is a function object that calls compare(xxxxxx, true) on

> the stateSets to force compareAttributeContents. As you can tell by this I

> have no idea how to define this without looking at my STL book!

>

 

Ok, I have read the book now. So it is something like.

 

struct StateSetLess

{

      bool operator(){const osg::ref_ptr<osg::StateSet>& p, const osg::ref_ptr<osg::StateSet>& q) const

      {

            return (p->compare(*q, true) < 0) ? true : false;

      }

};

 

std::map< osg::ref_ptr<osg::StateSet>, domMaterial *, StateSetLess > materialMap;

 

Roger

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to