AI aircraft are out of range or the piloted aircraft has no radar system.
These computation include range, bearing, and angular offset relative to the
piloted aircraft. This gives some external script the control the behavior
of the AI aircraft relative to the piloted aircraft without requiring a radar
system, and without requiring the AI aircraft to be within radar range.
double FGAIBase::UpdateRadar(FGAIManager* manager)
{
double radar_range_ft2 = fgGetDouble("/instrumentation/radar/range");
+ bool force_on = fgGetBool("/instrumentation/radar/debug-mode", false);
radar_range_ft2 *= SG_NM_TO_METER * SG_METER_TO_FEET * 1.1; // + 10%
radar_range_ft2 *= radar_range_ft2;
// Test whether the target is within radar range.
//
in_range = (range_ft2 && (range_ft2 <= radar_range_ft2));
- if ( in_range )
+ if ( in_range || force_on )
{
props->setBoolValue("radar/in-range", true);