Hi Art,

Of course the amount of repeats should be changeable during run time, hence simple multiple "copy" of group A will not work.

Make a subclass of osg::Group which has an overridden traverse() method, which is like this:

void traverse(osg::NodeVisitor& nv)
{
    for (unsigned int i = 0; i < _numRepeat; ++i)
    {
        osg::Group::traverse(nv);
    }
}

and with a getter and setter for the _numRepeat variable... Maybe add a copy-ctor that takes an osg::Group to replicate any group, and a static function that allows it to replace a group in-place easily...

You could also customize the traverse so that the children are traversed only once for update traversals, but _numRepeat times for cull traversals, if all you want is X number of renders.

Does that work for you?

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to