]> git.mxchange.org Git - flightgear.git/commitdiff
Small refactoring of Torsten's refactoring
authoronox <denkpadje@gmail.com>
Thu, 30 Apr 2015 12:54:36 +0000 (14:54 +0200)
committerErik Hofman <erik@ehofman.com>
Mon, 18 May 2015 10:35:00 +0000 (12:35 +0200)
Signed-off-by: onox <denkpadje@gmail.com>
Signed-off-by: Erik Hofman <erik@ehofman.com>
src/AIModel/submodel.cxx

index d66a8e413494c19dc347a9140e78bd6627f7d0c7..b93a779a73cce59023c64735240efde1cafe4ab8 100644 (file)
@@ -264,12 +264,6 @@ bool FGSubmodelMgr::release(submodel *sm, double dt)
         sm->first_time = false;
     }
 
-    double yaw_offset   = 0.0;
-    double pitch_offset = 0.0;
-
-    yaw_offset = sm->yaw_offset->get_value();
-    pitch_offset = sm->pitch_offset->get_value();
-
     transform(sm);  // calculate submodel's initial conditions in world-coordinates
 
     FGAIBallistic* ballist = new FGAIBallistic;
@@ -308,8 +302,8 @@ bool FGSubmodelMgr::release(submodel *sm, double dt)
     ballist->setXoffset(sm->x_offset);
     ballist->setYoffset(sm->y_offset);
     ballist->setZoffset(sm->z_offset);
-    ballist->setPitchoffset(pitch_offset);
-    ballist->setYawoffset(yaw_offset);
+    ballist->setPitchoffset(sm->pitch_offset->get_value());
+    ballist->setYawoffset(sm->yaw_offset->get_value());
     ballist->setParentNodes(_selected_ac);
     ballist->setContentsNode(sm->contents_node);
     ballist->setWeight(sm->weight);
@@ -359,11 +353,8 @@ void FGSubmodelMgr::transform(submodel *sm)
     if (sm->speed_node != 0)
         sm->speed = sm->speed_node->getDoubleValue();
 
-    double yaw_offset   = 0.0;
-    double pitch_offset = 0.0;
-
-    yaw_offset = sm->yaw_offset->get_value();
-    pitch_offset = sm->pitch_offset->get_value();
+    double yaw_offset = sm->yaw_offset->get_value();
+    double pitch_offset = sm->pitch_offset->get_value();
 
     //cout << " name " << name << " id " << id << " sub id" << sub_id << endl;