X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Fridge_lift.cxx;h=3b675a93ff686f3d4c3eef285018f8fda05fa1da;hb=dc76290d6e7d2f24d6c352d8f9da4b0f9f1e5f40;hp=5f0bd26396dc5ea40a9c1ec19e1b9047a5c38b98;hpb=03aac3de8b82eb318b92d7c1674aedda28e4c838;p=flightgear.git diff --git a/src/Environment/ridge_lift.cxx b/src/Environment/ridge_lift.cxx index 5f0bd2639..3b675a93f 100644 --- a/src/Environment/ridge_lift.cxx +++ b/src/Environment/ridge_lift.cxx @@ -36,25 +36,12 @@ #include #include #include - +#include using std::string; #include "ridge_lift.hxx" -static string CreateIndexedPropertyName(string Property, int index) -{ - std::stringstream str; - str << index; - string tmp; - str >> tmp; - return Property + "[" + tmp + "]"; -} - -static inline double sign(double x) { - return x == 0 ? 0 : x > 0 ? 1.0 : -1.0; -} - static const double BOUNDARY1_m = 40.0; const double FGRidgeLift::dist_probe_m[] = { // in meters @@ -172,7 +159,7 @@ void FGRidgeLift::update(double dt) { slope[3] = (probe_elev_m[4] - probe_elev_m[0]) / -dist_probe_m[4]; for (unsigned i = 0; i < sizeof(slope)/sizeof(slope[0]); i++) - adj_slope[i] = sin(atan(5.0 * pow ( (fabs(slope[i])),1.7) ) ) *sign(slope[i]); + adj_slope[i] = sin(atan(5.0 * pow ( (fabs(slope[i])),1.7) ) ) *SG_SIGN(slope[i]); //adjustment adj_slope[0] *= 0.2;