]> git.mxchange.org Git - flightgear.git/commitdiff
Split up model[] into ship[], aircraft[], ballistic[] and model[] (for unspecified...
authorehofman <ehofman>
Mon, 22 Dec 2003 12:30:35 +0000 (12:30 +0000)
committerehofman <ehofman>
Mon, 22 Dec 2003 12:30:35 +0000 (12:30 +0000)
src/AIModel/AIAircraft.cxx
src/AIModel/AIBallistic.cxx
src/AIModel/AIBase.cxx
src/AIModel/AIBase.hxx
src/AIModel/AIShip.cxx

index 27952de2e3ea429d8cc4532b7d3c69d9e67ea566..afe8663ad8b078fc433a619b80aeba9ba20f90c9 100644 (file)
@@ -51,6 +51,7 @@ FGAIAircraft::FGAIAircraft() {
    // set heading and altitude locks
    hdg_lock = false;
    alt_lock = false;
+   _type_str = "aircraft";
 }
 
 
index 6a0866856a7fcfaa1d8bb801e4125cef13403a56..86703da9c6065e471369d5ae235865aca3de0a07 100644 (file)
@@ -28,6 +28,7 @@
 
 
 FGAIBallistic::FGAIBallistic() {
+    _type_str = "ballistic";
 }
 
 FGAIBallistic::~FGAIBallistic() {
index baa5cc52f6c5f6298ac7f1b41ead2aafab699d87..7ffbc8b9edc7eeae07f78e6a41c4d5e8cd9d1c42 100644 (file)
@@ -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<SGPropertyNode_ptr> p_vec = root->getChildren("model");
+   vector<SGPropertyNode_ptr> 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,
index 21904376f8ed168b567b04ce89d1893f95dc63a8..412a6c20b84f0773b6fa4d3ee0b68f65534bd72a 100644 (file)
@@ -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 ();
+
 };
 
 
index 3f27e35d7a0a42aa5319889670c3fc000f384d04..bd9ebb09fbdf177baa998967757e3ba2ae5d0684 100644 (file)
@@ -30,6 +30,7 @@
 FGAIShip::FGAIShip() {
    hdg_lock = false;
    rudder = 0.0;
+   _type_str = "ship";
 }
 
 FGAIShip::~FGAIShip() {