Hi Giuseppe, osg::Drawable now subclasses from osg::Node so a deep copy of Node should create a new instances of any Drawables contained.
This might not be what you are looking for, but it's not a bug. If you want to clone a subgraph and share things in a specific way then you'll need to write a NodeVisitor to clone and share the bits you want. Robert. On 28 October 2014 11:14, Giuseppe Donvito <[email protected]> wrote: > I've found a weird behavior in the clone() method when the sub-graph to be > cloned has a group with a ParticleSystem (or drawable) directly attached to > it. > > For instance in this case if you want apply a shallow copy for drawables > and a deep copy for nodes and statesets, this piece of code will fail: > osg::ref_ptr<osg::Node> > copy = > static_cast<osg::Node*>(subgraph->clone(osg::CopyOp::DEEP_COPY_NODES | > osg::CopyOp::DEEP_COPY_STATESETS)); > > The "copy" instance will have full copies of ParticleSystems (or > drawables) instead of copies by reference. > I think this is due to the generic cast to "Node" objects in the Group > constructor iteration for copy. (osg version 3.3.2, Group.cpp, line 39). > > this bug, if verified, could cause performance issues in term of memory > footprint. > > BR, > Giuseppe > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
