- SlaveFDMList.push_back(new slaveData);
- SlaveFDMList.back()->exec = new FGFDMExec();
- SlaveFDMList.back()->exec->SetSlave(true);
-/*
- string AircraftName = AC_cfg->GetValue("file");
-
- debug_lvl = 0; // turn off debug output for slave vehicle
-
- SlaveFDMList.back()->exec->SetAircraftPath( AircraftPath );
- SlaveFDMList.back()->exec->SetEnginePath( EnginePath );
- SlaveFDMList.back()->exec->SetSystemsPath( SystemsPath );
- SlaveFDMList.back()->exec->LoadModel(AircraftName);
- debug_lvl = saved_debug_lvl; // turn debug output back on for master vehicle
-
- AC_cfg->GetNextConfigLine();
- while ((token = AC_cfg->GetValue()) != string("/SLAVE")) {
- *AC_cfg >> token;
- if (token == "xloc") { *AC_cfg >> SlaveFDMList.back()->x; }
- else if (token == "yloc") { *AC_cfg >> SlaveFDMList.back()->y; }
- else if (token == "zloc") { *AC_cfg >> SlaveFDMList.back()->z; }
- else if (token == "pitch") { *AC_cfg >> SlaveFDMList.back()->pitch;}
- else if (token == "yaw") { *AC_cfg >> SlaveFDMList.back()->yaw; }
- else if (token == "roll") { *AC_cfg >> SlaveFDMList.back()->roll; }
- else cerr << "Unknown identifier: " << token << " in slave vehicle definition" << endl;
+ struct childData* child = new childData;
+
+ child->exec = new FGFDMExec(Root, FDMctr);
+ child->exec->SetChild(true);
+
+ string childAircraft = el->GetAttributeValue("name");
+ string sMated = el->GetAttributeValue("mated");
+ if (sMated == "false") child->mated = false; // child objects are mated by default.
+ string sInternal = el->GetAttributeValue("internal");
+ if (sInternal == "true") child->internal = true; // child objects are external by default.
+
+ child->exec->SetAircraftPath( AircraftPath );
+ child->exec->SetEnginePath( EnginePath );
+ child->exec->SetSystemsPath( SystemsPath );
+ child->exec->LoadModel(childAircraft);
+
+ Element* location = el->FindElement("location");
+ if (location) {
+ child->Loc = location->FindElementTripletConvertTo("IN");
+ } else {
+ cerr << endl << highint << fgred << " No location was found for this child object!" << reset << endl;
+ exit(-1);