Added support for Group::addChild/setChild/getChild/getNumChildren.

This commit is contained in:
Robert Osfield
2013-10-23 16:17:26 +00:00
parent c45f3aa4fb
commit f548bc79d4
2 changed files with 246 additions and 30 deletions

View File

@@ -94,7 +94,13 @@ class ReaderWriterLua : public osgDB::ReaderWriter
if (objects.empty()) return 0;
if (objects.size()==1) return objects[0].get();
if (objects.size()==1)
{
osg::Group* group = dynamic_cast<osg::Group*>(objects[0].get());
OSG_NOTICE<<"readObject form script, have one object "<<objects[0]->className()<<" "<<objects[0].get()<<std::endl;
if (group) OSG_NOTICE<<" group numChildren()="<<group->getNumChildren()<<std::endl;
return objects[0].get();
}
osg::ref_ptr<osg::Group> group = new osg::Group;
for(Objects::iterator itr = objects.begin();