]> git.mxchange.org Git - flightgear.git/commitdiff
Added flap_deflection so that remote fdm can pass back actual flap deflection
authorcurt <curt>
Mon, 3 Jun 2002 23:35:43 +0000 (23:35 +0000)
committercurt <curt>
Mon, 3 Jun 2002 23:35:43 +0000 (23:35 +0000)
in order to drive the flap sound effects and animation.

src/FDM/ExternalNet.cxx
src/Network/net_fdm.hxx

index 97374d84e761dad46cc3b3e9be7325630c6a21b6..160dc2f8370802d71b88aa2ec9b7085275b481f5 100644 (file)
@@ -149,8 +149,8 @@ static void net2global( FGNetFDM *net ) {
     }
 
     net->num_wheels = htonl(net->num_wheels);
-
     // I don't need to convert the Wow flags, since they are one byte in size
+    htond(net->flap_deflection);
 
     net->cur_time = ntohl(net->cur_time);
     net->warp = ntohl(net->warp);
@@ -213,6 +213,8 @@ static void net2global( FGNetFDM *net ) {
            node->setDoubleValue("wow", net->wow[i] );
        }
 
+        fgSetDouble("/surface-positions/flap-pos-norm", net->flap_deflection);
+
        /* these are ignored for now  ... */
        /*
        if ( net->cur_time ) {
index e40b7916a1bcda349bcbc0773928fcfeabc76a78..2363f29285afb6c33574d7ab47ca9094dffcd92d 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <time.h> // time_t
 
-const int FG_NET_FDM_VERSION = 6;
+const int FG_NET_FDM_VERSION = 7;
 
 
 // Define a structure containing the top level flight dynamics model
@@ -88,9 +88,10 @@ public:
     int num_tanks;             // Max number of fuel tanks
     double fuel_quantity[FG_MAX_TANKS];
 
-    // Gear status
+    // Gear and flaps status
     int num_wheels;
     bool wow[FG_MAX_WHEELS];
+    double flap_deflection;     // normalized from 0 = up to 1 = full deflection
 
     // Environment
     time_t cur_time;            // current unix time