]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_ladder.cxx
Cleanup part2. Forgotton file.
[flightgear.git] / src / Instrumentation / HUD / HUD_ladder.cxx
index 0b7784a27f91642728e1ce1b7f20066d7860db84..92a39f68e4791bbd57cd3b9049978b18ffd030cb 100644 (file)
 #include <sstream>
 #include <simgear/math/SGGeometry.hxx>
 #include <Viewer/viewer.hxx>
+
 #include "HUD.hxx"
+#include "HUD_private.hxx"
+
+#include <Main/fg_props.hxx>
 
 using std::string;
 
@@ -174,14 +178,14 @@ void HUD::Ladder::draw(void)
             actslope = atan(up_vel / ground_vel) * SGD_RADIANS_TO_DEGREES;
         }
 
-        xvvr = (-drift * (_compression / globals->get_current_view()->get_aspect_ratio()));
+        xvvr = drift * _compression;
         // drift = ((atan2(Vyy, Vxx) * SGD_RADIANS_TO_DEGREES) - psi);
         // yvvr = (-alpha * _compression);
         // vel_y = (-alpha * cos(roll_value) + drift * sin(roll_value)) * _compression;
         // vel_x = (alpha * sin(roll_value) + drift * cos(roll_value))
         //         * (_compression / globals->get_current_view()->get_aspect_ratio());
         vel_y = -alpha * _compression;
-        vel_x = -drift * (_compression / globals->get_current_view()->get_aspect_ratio());
+        vel_x = drift * _compression;
         //  printf("%f %f %f %f\n",vel_x, vel_y, drift, psi);
 
         //****************************************************************
@@ -270,9 +274,10 @@ void HUD::Ladder::draw(void)
             SGPropertyNode *chld = models->getChild(i);
             string name;
             name = chld->getName();
-            if (name == "aircraft" || name == "multiplayer") {
-                string callsign = chld->getStringValue("callsign");
-                if (callsign != "") {
+            if (name == "tanker" || name == "aircraft" || name == "multiplayer") {
+                bool valid = chld->getBoolValue("valid");
+                bool in_range = chld->getBoolValue("radar/in-range", true);
+                if (valid && in_range) {
                     float h_deg = chld->getFloatValue("radar/h-offset");
                     float v_deg = chld->getFloatValue("radar/v-offset");
                     float pos_x = (h_deg * cos(roll_value) -