]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIThermal.cxx
Overhaul the ground-net / parking code.
[flightgear.git] / src / AIModel / AIThermal.cxx
index 19d64632513f35101bfa290f89443d4ff115a7ca..4b1d653f80a4648ff67277154876ac048e4690c4 100644 (file)
@@ -35,7 +35,9 @@ using std::string;
 #include "AIThermal.hxx"
 
 
-FGAIThermal::FGAIThermal() : FGAIBase(otThermal) {
+FGAIThermal::FGAIThermal() :
+   FGAIBase(otThermal, false)
+{
    max_strength = 6.0;
    diameter = 0.5;
    strength = factor = 0.0;
@@ -75,38 +77,25 @@ bool FGAIThermal::init(bool search_in_AI_path) {
 }
 
 void FGAIThermal::bind() {
-       props->tie("position/altitude-agl-ft", // for debug and tweak
+    FGAIBase::bind();
+    tie("position/altitude-agl-ft", // for debug and tweak
                 SGRawValuePointer<double>(&altitude_agl_ft));
-       props->tie("alt-rel", // for debug and tweak
+    tie("alt-rel", // for debug and tweak
                 SGRawValuePointer<double>(&alt_rel));
-       props->tie("time", // for debug and tweak
+    tie("time", // for debug and tweak
                 SGRawValuePointer<double>(&time));
-       props->tie("xx", // for debug and tweak
+    tie("xx", // for debug and tweak
                 SGRawValuePointer<double>(&xx));
-       props->tie("is-forming", // for debug abd tweak
+    tie("is-forming", // for debug abd tweak
                 SGRawValuePointer<bool>(&is_forming));
-       props->tie("is-formed", // for debug abd tweak
+    tie("is-formed", // for debug abd tweak
                 SGRawValuePointer<bool>(&is_formed));
-       props->tie("is-dying", // for debug abd tweak
+    tie("is-dying", // for debug abd tweak
                 SGRawValuePointer<bool>(&is_dying));
-       props->tie("is-dead", // for debug abd tweak
+    tie("is-dead", // for debug abd tweak
                 SGRawValuePointer<bool>(&is_dead));
-    FGAIBase::bind();
 }
 
-void FGAIThermal::unbind() {
-       props->untie("position/altitude-agl-ft");
-       props->untie("alt-rel");
-       props->untie("time");   
-       props->untie("is-forming");
-       props->untie("is-formed");
-       props->untie("is-dying");
-       props->untie("is-dead");
-       props->untie("xx");
-    FGAIBase::unbind();
-}
-
-
 void FGAIThermal::update(double dt) {
    FGAIBase::update(dt);
    Run(dt);
@@ -229,7 +218,7 @@ double user_altitude  = manager->get_user_altitude(); // MSL
 dt_count += dt;
 if (dt_count >= 10.0 ) {
        //double alt;
-       if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(pos, 20000), alt, 0)){    
+       if (getGroundElevationM(SGGeod::fromGeodM(pos, 20000), alt, 0)) {
        ground_elev_ft =  alt * SG_METER_TO_FEET;
        do_agl_calc = 0;
        altitude_agl_ft = height - ground_elev_ft ;