]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.cxx
Vivian Meazza:
[flightgear.git] / src / AIModel / AIBase.cxx
index e816b232b70d6c5561c472dd1c688ec34362a66f..8ec57b527df2ae9f244404ed6ef49959909c3983 100644 (file)
@@ -51,13 +51,12 @@ const double FGAIBase::lbs_to_slugs = 0.031080950172;   //conversion factor
 
 FGAIBase::FGAIBase()
   : fp( NULL ),
-    model( NULL ),
     props( NULL ),
     manager( NULL ),
     _refID( _newAIModelID() )
 {
     _type_str = "model";
-    tgt_heading = tgt_altitude = tgt_speed = 0.0;
+    tgt_heading = hdg = tgt_altitude = tgt_speed = 0.0;
     tgt_roll = roll = tgt_pitch = tgt_yaw = tgt_vs = vs = pitch = 0.0;
     bearing = elevation = range = rdot = 0.0;
     x_shift = y_shift = rotation = 0.0;
@@ -82,8 +81,6 @@ FGAIBase::~FGAIBase() {
     root->removeChild(_type_str.c_str(), index);
     delete fp;
     fp = NULL;
-    ssgDeRefDelete(model);
-    model = 0;
 }
 
 void FGAIBase::update(double dt) {
@@ -151,7 +148,6 @@ ssgBranch * FGAIBase::load3DModel(const string& fg_root,
   // some more code here to check whether a model with this name has already been loaded
   // if not load it, otherwise, get the memory pointer and do something like 
   // SetModel as in ATC/AIEntity.cxx
-  //SSGBranch *model;
   model = manager->getModel(path);
   if (!(model))
     {
@@ -161,17 +157,7 @@ ssgBranch * FGAIBase::load3DModel(const string& fg_root,
                            sim_time_sec);
       manager->setModel(path, model);
     }
-  //else
-  //  {
-  //    model->ref();
-  //    aip.init(model);
-  //    aip.setVisible(false);
-  //    globals->get_scenery()->get_scene_graph()->addKid(aip.getSceneGraph());
-  // do some setModel stuff.
   
-  if (model)
-    model->ref();
-
   return model;
 }