static bool readChildren( osgDB::InputStream& is, osg::CompositeShape& shape )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::ref_ptr<osg::Shape> child = is.readObjectOfType<osg::Shape>();
        if ( child ) shape.addChild( child );
    }
    is >> is.END_BRACKET;
    return true;
}
Example #2
0
static bool readChildren( osgDB::InputStream& is, osg::CompositeShape& shape )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::Shape* child = dynamic_cast<osg::Shape*>( is.readObject() );
        if ( child ) shape.addChild( child );
    }
    is >> is.END_BRACKET;
    return true;
}