static string tempReg;
-FGAIAircraft::FGAIAircraft(FGAISchedule *ref) : FGAIBase(otAircraft) {
+FGAIAircraft::FGAIAircraft(FGAISchedule *ref) :
+ /* HOT must be disabled for AI Aircraft,
+ * otherwise traffic detection isn't working as expected.*/
+ FGAIBase(otAircraft, false)
+{
trafficRef = ref;
if (trafficRef) {
groundOffset = trafficRef->getGroundOffset();
- setCallSign(trafficRef->getCallSign());
+ setCallSign(trafficRef->getCallSign());
}
else
groundOffset = 0;
const double FGAIBallistic::slugs_to_lbs = 32.1740485564;
FGAIBallistic::FGAIBallistic(object_type ot) :
-FGAIBase(ot),
+FGAIBase(ot, false),
_height(0.0),
_speed(0),
_ht_agl_ft(0.0),
using namespace simgear;
-FGAIBase::FGAIBase(object_type ot) :
+FGAIBase::FGAIBase(object_type ot, bool enableHot) :
_max_speed(300),
_name(""),
_parent(""),
p = 1e5;
a = 340;
Mach = 0;
+
+ // explicitly disable HOT for (most) AI models
+ if (!enableHot)
+ aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
}
FGAIBase::~FGAIBase() {
otEscort, otMultiplayer,
MAX_OBJECTS }; // Needs to be last!!!
- FGAIBase(object_type ot);
+ FGAIBase(object_type ot, bool enableHot);
virtual ~FGAIBase();
virtual void readFromScenario(SGPropertyNode* scFileNode);
#include "AIMultiplayer.hxx"
-#include <simgear/scene/util/SGNodeMasks.hxx>
// #define SG_DEBUG SG_ALERT
-FGAIMultiplayer::FGAIMultiplayer() : FGAIBase(otMultiplayer) {
+FGAIMultiplayer::FGAIMultiplayer() :
+ FGAIBase(otMultiplayer, false)
+{
no_roll = false;
mTimeOffsetSet = false;
mAllowExtrapolation = true;
mLagAdjustSystemSpeed = 10;
mLastTimestamp = 0;
- aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
lastUpdateTime = 0;
}
FGAIShip::FGAIShip(object_type ot) :
-FGAIBase(ot),
+// allow HOT to be enabled
+FGAIBase(ot, true),
_waiting(false),
#include "AIStatic.hxx"
-FGAIStatic::FGAIStatic() : FGAIBase(otStatic) {
+FGAIStatic::FGAIStatic() : FGAIBase(otStatic, false) {
}
#include "AIStorm.hxx"
-FGAIStorm::FGAIStorm() : FGAIBase(otStorm) {
+FGAIStorm::FGAIStorm() :
+ FGAIBase(otStorm, false)
+{
delay = 3.6;
subflashes = 1;
timer = 0.0;
#include "AIThermal.hxx"
-FGAIThermal::FGAIThermal() : FGAIBase(otThermal) {
+FGAIThermal::FGAIThermal() :
+ FGAIBase(otThermal, false)
+{
max_strength = 6.0;
diameter = 0.5;
strength = factor = 0.0;