]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AICarrier.cxx
commradio: improvements for atis speech
[flightgear.git] / src / AIModel / AICarrier.cxx
index 8a39b1467759412a1854a3d06258363a4b8481b8..fae5d26bc38b91b76ee9028d99b8d091a117ca78 100644 (file)
 #include <vector>
 
 #include <simgear/sg_inlines.h>
-#include <simgear/math/SGMath.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 
 #include <math.h>
 #include <Main/util.hxx>
-#include <Viewer/viewer.hxx>
 
 #include "AICarrier.hxx"
 
@@ -75,7 +73,7 @@ void FGAICarrier::readFromScenario(SGPropertyNode* scFileNode) {
   std::vector<SGPropertyNode_ptr> props = scFileNode->getChildren("parking-pos");
   std::vector<SGPropertyNode_ptr>::const_iterator it;
   for (it = props.begin(); it != props.end(); ++it) {
-    string name = (*it)->getStringValue("name", "unnamed");
+    const string name = (*it)->getStringValue("name", "unnamed");
     // Transform to the right coordinate frame, configuration is done in
     // the usual x-back, y-right, z-up coordinates, computations
     // in the simulation usual body x-forward, y-right, z-down coordinates
@@ -167,7 +165,7 @@ void FGAICarrier::update(double dt) {
     SGVec3d cartPos = SGVec3d::fromGeod(pos);
 
     // The position of the eyepoint - at least near that ...
-    SGVec3d eyePos(globals->get_current_view()->get_view_pos());
+    SGVec3d eyePos(globals->get_view_position_cart());
     // Add the position offset of the AIModel to gain the earth
     // centered position
     SGVec3d eyeWrtCarrier = eyePos - cartPos;
@@ -499,7 +497,6 @@ bool FGAICarrier::OutsideBox() { //returns true if the carrier is outside operat
             return true;
     }
 
-    SG_LOG(SG_AI, SG_DEBUG, "AICarrier: Inside Operating Box" );
     return false;
 
 } // end OutsideBox
@@ -551,7 +548,7 @@ void FGAICarrier::UpdateElevator(double dt, double transition_time) {
 
 void FGAICarrier::UpdateJBD(double dt, double jbd_transition_time) {
 
-    string launchbar_state = _launchbar_state_node->getStringValue();
+    const string launchbar_state = _launchbar_state_node->getStringValue();
     double step = 0;
 
     if (launchbar_state == "Engaged"){