Ulrich,

Thanx. This realy did the trick. 

Regards Ragnar

-----Ursprungligt meddelande-----
Från: [email protected] 
[mailto:[email protected]] För Ulrich Hertlein
Skickat: den 7 oktober 2009 11:11
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] Trying To obtain all statsets in a Graph

Hi Ragnar,

On 7/10/09 10:48 AM, Ragnar Hammarqvist wrote:
> I'm using a visitor to obtain all Statsets in a graph. But the visitor dose 
> not collects all statsets, why?
>
> Code im using is simply this:
>...
> void apply(osg::Node&n)
> {
>       if(n.getStateSet())
>       {
>               m_Statsets.insert(n.getStateSet());
>       }
>       traverse(n);
> };

You're only collecting StateSets attached to nodes, but they can also be 
attached to Drawables, so you need to handle Geodes separately (iterating over 
all drawables).

HTH,
Cheers,
/ulrich
_______________________________________________
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