]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIGroundVehicle.cxx
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / AIModel / AIGroundVehicle.cxx
index 83e67626d057ef0a8ca936c26a4a474e3acb780a..257a73517c3397e78eeb3d18043b3c3d881ff8c7 100644 (file)
@@ -40,11 +40,11 @@ _speed_kt(0),
 _range_ft(0),
 _relbrg (0),
 _parent_speed(0),
-_dt_count(0),
-_next_run(0),
 _parent_x_offset(0),
 _parent_y_offset(0),
 _parent_z_offset(0),
+_dt_count(0),
+_next_run(0),
 _break_count(0)
 
 {
@@ -232,39 +232,6 @@ void FGAIGroundVehicle::setTowAngle(double ta, double dt, double coeff){
     SG_CLAMP_RANGE(_tow_angle, -limit, limit);
 }
 
-//bool FGAIGroundVehicle::getGroundElev(SGGeod inpos) {
-//
-//    double height_m ;
-//
-//    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
-//            _ht_agl_ft = inpos.getElevationFt() - height_m * SG_METER_TO_FEET;
-//
-//            if (_material) {
-//                const vector<string>& names = _material->get_names();
-//
-//                _solid = _material->get_solid();
-//
-//                if (!names.empty())
-//                    props->setStringValue("material/name", names[0].c_str());
-//                else
-//                    props->setStringValue("material/name", "");
-//
-//                //cout << "material " << names[0].c_str()
-//                //    << " _elevation_m " << _elevation_m
-//                //    << " solid " << _solid
-//                //    << " load " << _load_resistance
-//                //    << " frictionFactor " << _frictionFactor
-//                //    << endl;
-//
-//            }
-//
-//            return true;
-//    } else {
-//        return false;
-//    }
-//
-//}
-
 bool FGAIGroundVehicle::getPitch() {
 
     if (!_tunnel){
@@ -285,7 +252,7 @@ bool FGAIGroundVehicle::getPitch() {
         double rear_elev_m = 0;
         double elev_front = 0;
         double elev_rear = 0;
-        double max_alt = 10000;
+        //double max_alt = 10000;
 
         if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodFront, 3000),
             elev_front, &_material, 0)){
@@ -391,12 +358,6 @@ void FGAIGroundVehicle::calcRangeBearing(double lat, double lon, double lat2, do
     range = distance * SG_METER_TO_NM;
 }
 
-double FGAIGroundVehicle::calcRelBearingDeg(double bearing, double heading)
-{
-    double angle = bearing - heading;
-    SG_NORMALIZE_RANGE(angle, -180.0, 180.0);
-    return angle;
-}
 
 SGVec3d FGAIGroundVehicle::getCartHitchPosAt(const SGVec3d& _off) const {
     double hdg = _selected_ac->getDoubleValue("orientation/true-heading-deg");
@@ -480,7 +441,7 @@ void FGAIGroundVehicle::AdvanceFP(){
 
 void FGAIGroundVehicle::setTowSpeed(){
 
-    double diff = _range_ft - _x_offset;
+    //double diff = _range_ft - _x_offset;
     double  x = 0;
 
     if (_range_ft > _x_offset * 3) x = 50;
@@ -537,7 +498,7 @@ void FGAIGroundVehicle::RunGroundVehicle(double dt){
 
     string parent_next_name = _selected_ac->getStringValue("waypoint/name-next");
     bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting");
-    bool parent_restart = _selected_ac->getBoolValue("controls/restart"); 
+    //bool parent_restart = _selected_ac->getBoolValue("controls/restart"); 
 
     if (parent_next_name == "END" && fp->getNextWaypoint()->name != "END" ){
         SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name