]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.cxx
#358: Missing option to disable AI scenarios
[flightgear.git] / src / AIModel / AIBase.cxx
index c206691a89436bc1503a88b33432ba1250a154c7..ac907c2e383e5263546dfa30df4f62493e9a3a54 100644 (file)
@@ -52,15 +52,15 @@ const double FGAIBase::lbs_to_slugs = 0.031080950172;   //conversion factor
 
 using namespace simgear;
 
-FGAIBase::FGAIBase(object_type ot) :
+FGAIBase::FGAIBase(object_type ot, bool enableHot) :
     _max_speed(300),
     _name(""),
     _parent(""),
     props( NULL ),
     model_removed( fgGetNode("/ai/models/model-removed", true) ),
     manager( NULL ),
-    fp( NULL ),
     _installed(false),
+    fp( NULL ),
     _impact_lat(0),
     _impact_lon(0),
     _impact_elev(0),
@@ -121,6 +121,10 @@ FGAIBase::FGAIBase(object_type ot) :
     p = 1e5;
     a = 340;
     Mach = 0;
+
+    // explicitly disable HOT for (most) AI models
+    if (!enableHot)
+        aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
 }
 
 FGAIBase::~FGAIBase() {
@@ -611,7 +615,7 @@ double FGAIBase::_getRdot() const {
 }
 
 double FGAIBase::_getVS_fps() const {
-    return vs*60.0;
+    return vs/60.0;
 }
 
 double FGAIBase::_get_speed_east_fps() const {
@@ -623,7 +627,7 @@ double FGAIBase::_get_speed_north_fps() const {
 }
 
 void FGAIBase::_setVS_fps( double _vs ) {
-    vs = _vs/60.0;
+    vs = _vs*60.0;
 }
 
 double FGAIBase::_getAltitude() const {