On Wed, 15 Oct 2008 22:43:14 +0200, ami guru <[EMAIL PROTECTED]> wrote:
Hello forum
Is there any difference between these following:
1. osg::ref_ptr<osg::StateSet> nodess3 = new
StateSet((myshapegeode3->getOrCreateStateSet()));
2. osg::ref_ptr<osg::StateSet>
nodess3((myshapegeode3->getOrCreateStateSet()));
Yes they differ. But do you want to do? Copy the stateset?
If you want to share the stateset (for example, edit myshapegeode3's
stateset) do this:
osg::ref_ptr<osg::StateSet> nodess3 = myshapegeode3->getOrCreateStateSet();
If you want to copy it, do this:
osg::ref_ptr<osg::StateSet> nodess3 =
myshapegeode3->getOrCreateStateSet()->clone(osg::CopyOp::DEEP_COPY_ALL));
--
Joakim Simonsson
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org