[osg-users] Accessing StateSets

Ethan Kerzner ethan.kerzner at survice.com
Fri Apr 8 12:19:25 PDT 2011


Hi,

I am trying to access the material stored in a stateset. Is this possible? 

My approach is below- the first line returns a null pointer.


Code:
osg::StateAttribute* sa = myGeode.getOrCreateStateSet()->getAttribute(osg::StateAttribute::MATERIAL);
osg::Material* mat = dynamic_cast<osg::Material*>(sa);




Thank you!

Cheers,
ethan

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








More information about the osg-users mailing list