if a model XML file contains a <multiplayer> block, copy its contents

to the model's property root (/ai/models/multiplayer[*])
This commit is contained in:
mfranz
2008-10-09 22:20:33 +00:00
parent d7f2966216
commit 98a3e7cffa
+5 -1
View File
@@ -135,8 +135,8 @@ sgLoad3DModel_internal(const string &path,
{ {
if ( !prop_root ) { if ( !prop_root ) {
SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path); SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path);
} }
string fg_root=osgDB::Registry::instance()->getDataFilePathList().front(); string fg_root=osgDB::Registry::instance()->getDataFilePathList().front();
osg::ref_ptr<osg::Node> model; osg::ref_ptr<osg::Node> model;
osg::ref_ptr<osg::Group> group; osg::ref_ptr<osg::Group> group;
@@ -168,6 +168,10 @@ sgLoad3DModel_internal(const string &path,
} else { } else {
model = new osg::Node; model = new osg::Node;
} }
SGPropertyNode *mp = props->getNode("multiplayer");
if (mp && prop_root && prop_root->getParent())
copyProperties(mp, prop_root);
} }
osg::ref_ptr<osgDB::ReaderWriter::Options> options osg::ref_ptr<osgDB::ReaderWriter::Options> options