From: ehofman Date: Mon, 22 Dec 2003 12:30:35 +0000 (+0000) Subject: Split up model[] into ship[], aircraft[], ballistic[] and model[] (for unspecified... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2d7a6e475d2376619caa76185e326a0c2d059f96;p=flightgear.git Split up model[] into ship[], aircraft[], ballistic[] and model[] (for unspecified models). --- diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 27952de2e..afe8663ad 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -51,6 +51,7 @@ FGAIAircraft::FGAIAircraft() { // set heading and altitude locks hdg_lock = false; alt_lock = false; + _type_str = "aircraft"; } diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index 6a0866856..86703da9c 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -28,6 +28,7 @@ FGAIBallistic::FGAIBallistic() { + _type_str = "ballistic"; } FGAIBallistic::~FGAIBallistic() { diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index baa5cc52f..7ffbc8b9e 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -46,6 +46,7 @@ FGAIBase *FGAIBase::_self = NULL; FGAIBase::FGAIBase() { _self = this; + _type_str = "model"; } FGAIBase::~FGAIBase() { @@ -66,11 +67,11 @@ void FGAIBase::Transform() { bool FGAIBase::init() { SGPropertyNode *root = globals->get_props()->getNode("ai/modeles", true); - vector p_vec = root->getChildren("model"); + vector p_vec = root->getChildren(_type_str); unsigned num = p_vec.size(); p_vec.clear(); - props = root->getNode("model", num, true); + props = root->getNode(_type_str, num, true); ssgBranch *model = sgLoad3DModel( globals->get_fg_root(), model_path.c_str(), props, diff --git a/src/AIModel/AIBase.hxx b/src/AIModel/AIBase.hxx index 21904376f..412a6c20b 100644 --- a/src/AIModel/AIBase.hxx +++ b/src/AIModel/AIBase.hxx @@ -78,6 +78,7 @@ protected: void Transform(); static FGAIBase *_self; + const char *_type_str; private: @@ -85,6 +86,7 @@ private: static void _setLatitude ( double latitude ); static double _getLongitude(); static double _getLatitude (); + }; diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index 3f27e35d7..bd9ebb09f 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -30,6 +30,7 @@ FGAIShip::FGAIShip() { hdg_lock = false; rudder = 0.0; + _type_str = "ship"; } FGAIShip::~FGAIShip() {