1
0
Fork 0

From Vivian: add a tunable launchbar acceleration, to better support some

of the Jets on the catapult.
This commit is contained in:
andy 2009-05-01 16:11:23 +00:00 committed by Tim Moore
parent fd2361ef55
commit 2eebd94dac
5 changed files with 16 additions and 4 deletions

View file

@ -190,7 +190,8 @@ void ControlMap::applyControls(float dt)
switch(o->type) {
case THROTTLE: ((Thruster*)obj)->setThrottle(lval); break;
case MIXTURE: ((Thruster*)obj)->setMixture(lval); break;
case CONDLEVER: ((TurbineEngine*)((PropEngine*)obj)->getEngine())->setCondLever(lval); break;
case CONDLEVER: ((TurbineEngine*)((PropEngine*)
obj)->getEngine())->setCondLever(lval); break;
case STARTER: ((Thruster*)obj)->setStarter(lval != 0.0); break;
case MAGNETOS: ((PropEngine*)obj)->setMagnetos((int)lval); break;
case ADVANCE: ((PropEngine*)obj)->setAdvance(lval); break;
@ -203,6 +204,7 @@ void ControlMap::applyControls(float dt)
case EXTEND: ((Gear*)obj)->setExtension(lval); break;
case HEXTEND: ((Hook*)obj)->setExtension(lval); break;
case LEXTEND: ((Launchbar*)obj)->setExtension(lval); break;
case LACCEL: ((Launchbar*)obj)->setAcceleration(lval); break;
case CASTERING:((Gear*)obj)->setCastering(lval != 0); break;
case SLAT: ((Wing*)obj)->setSlat(lval); break;
case FLAP0: ((Wing*)obj)->setFlap0(lval, rval); break;

View file

@ -11,7 +11,7 @@ public:
enum OutputType { THROTTLE, MIXTURE, CONDLEVER, STARTER, MAGNETOS,
ADVANCE, REHEAT, PROP,
BRAKE, STEER, EXTEND, HEXTEND, LEXTEND,
BRAKE, STEER, EXTEND, HEXTEND, LEXTEND, LACCEL,
INCIDENCE, FLAP0, FLAP1, SLAT, SPOILER, VECTOR,
FLAP0EFFECTIVENESS, FLAP1EFFECTIVENESS,
BOOST, CASTERING, PROPPITCH, PROPFEATHER,

View file

@ -949,6 +949,7 @@ int FGFDM::parseOutput(const char* name)
if(eq(name, "EXTEND")) return ControlMap::EXTEND;
if(eq(name, "HEXTEND")) return ControlMap::HEXTEND;
if(eq(name, "LEXTEND")) return ControlMap::LEXTEND;
if(eq(name, "LACCEL")) return ControlMap::LACCEL;
if(eq(name, "INCIDENCE")) return ControlMap::INCIDENCE;
if(eq(name, "FLAP0")) return ControlMap::FLAP0;
if(eq(name, "FLAP0EFFECTIVENESS")) return ControlMap::FLAP0EFFECTIVENESS;

View file

@ -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;

View file

@ -28,6 +28,7 @@ public:
void setExtension(float extension);
void setLaunchCmd(bool cmd);
void setGlobalGround(double *global_ground);
void setAcceleration(float acceleration);
void getLaunchbarMount(float* out);
void getHoldbackMount(float* out);
@ -85,6 +86,7 @@ private:
bool _strop;
double _global_ground[4];
LBState _state;
float _acceleration;
};
}; // namespace yasim