]> git.mxchange.org Git - flightgear.git/commitdiff
Add a flag that allows the simulator to force "radar" computations even if
authorcurt <curt>
Fri, 16 Jun 2006 19:10:20 +0000 (19:10 +0000)
committercurt <curt>
Fri, 16 Jun 2006 19:10:20 +0000 (19:10 +0000)
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.

src/AIModel/AIBase.cxx

index 1b73b39e7030213659474250c7d3eccd95f91453..43a001cb94266ca3b24d470cd827e9df29045eb8 100644 (file)
@@ -266,6 +266,7 @@ void FGAIBase::unbind() {
 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;
 
@@ -279,7 +280,7 @@ double FGAIBase::UpdateRadar(FGAIManager* manager)
    // 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);