X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FYASim%2FLaunchbar.cpp;h=756e9a0345f02364712c5e720a278f3f8cd4e831;hb=d66903e9ad63b91182ccc25d9bb82f18f8dd98b6;hp=697fa5a1b72fb91c1deba5951b352ce8a4b1c1a2;hpb=32d3d33fea9410f3644b399454291493a02b040c;p=flightgear.git diff --git a/src/FDM/YASim/Launchbar.cpp b/src/FDM/YASim/Launchbar.cpp index 697fa5a1b..756e9a034 100644 --- a/src/FDM/YASim/Launchbar.cpp +++ b/src/FDM/YASim/Launchbar.cpp @@ -2,7 +2,6 @@ #include "BodyEnvironment.hpp" #include "Ground.hpp" #include "RigidBody.hpp" - #include "Launchbar.hpp" namespace yasim { @@ -32,6 +31,7 @@ Launchbar::Launchbar() _pos_on_cat = 0.0; _state = Unmounted; _strop = false; + _acceleration = 0.25; } void Launchbar::setLaunchbarMount(float* position) @@ -76,6 +76,11 @@ void Launchbar::setLaunchCmd(bool cmd) _launch_cmd = cmd; } +void Launchbar::setAcceleration(float acceleration) +{ + _acceleration = acceleration; +} + void Launchbar::setGlobalGround(double *global_ground) { int i; @@ -473,7 +478,9 @@ void Launchbar::calcForce(Ground *g_cb, RigidBody* body, State* s, float* lv, fl if (_state == Launch) { // Now apply a constant tension from the catapult over the launchbar. - Math::mul3(25.0, llbdir, _launchbar_force); + // We modify the max accleration 100 m/s^2 by the normalised input + //SG_LOG(SG_FLIGHT, SG_ALERT, "acceleration " << 100 * _acceleration ); + Math::mul3(100 * _acceleration, llbdir, _launchbar_force); if (1.0 < dist) { _state = Completed;