1
0
Fork 0
flightgear/src/FDM/YASim/Launchbar.hpp

92 lines
2.6 KiB
C++
Raw Normal View History

2005-02-17 10:37:26 +00:00
#ifndef _LAUNCHBAR_HPP
#define _LAUNCHBAR_HPP
namespace yasim {
class Ground;
class RigidBody;
2005-02-18 10:16:30 +00:00
struct State;
2005-02-17 10:37:26 +00:00
// A launchbar has the following parameters:
//
// position: a point in the aircraft's local coordinate system where the
// fully-extended wheel will be found.
//
class Launchbar {
public:
enum LBState { Arrested, Launch, Unmounted, Completed };
2005-02-17 10:37:26 +00:00
Launchbar();
// Externally set values
void setLaunchbarMount(float* position);
void setHoldbackMount(float* position);
void setLength(float length);
void setHoldbackLength(float length);
2005-02-17 10:37:26 +00:00
void setDownAngle(float ang);
void setUpAngle(float ang);
void setExtension(float extension);
void setLaunchCmd(bool cmd);
void setGlobalGround(double *global_ground);
void getLaunchbarMount(float* out);
void getHoldbackMount(float* out);
const char* getState(void);
2005-02-17 10:37:26 +00:00
float getLength(void);
float getHoldbackLength(void);
2005-02-17 10:37:26 +00:00
float getDownAngle(void);
float getUpAngle(void);
float getExtension(void);
bool getStrop(void);
2005-02-17 10:37:26 +00:00
void getTipPosition(float* out);
void getHoldbackTipPosition(float* out);
float getTipPos(int i);
float getHoldbackTipPos(int i);
2005-02-17 10:37:26 +00:00
void getTipGlobalPosition(State* s, double* out);
float getPercentPosOnCat(float* lpos, float off, float lends[2][3]);
void getPosOnCat(float perc, float* lpos, float* lvel,
float lends[2][3], float lendvels[2][3]);
// Takes a velocity of the aircraft relative to ground, a rotation
// vector, and a ground plane (all specified in local coordinates)
// and make a force and point of application (i.e. ground contact)
// available via getForce().
void calcForce(Ground *g_cb, RigidBody* body, State* s,
float* lv, float* lrot);
2005-02-17 10:37:26 +00:00
// Computed values: total force, weight-on-wheels (force normal to
// ground) and compression fraction.
void getForce(float* force1, float* off1, float* force2, float* off2);
2005-02-17 10:37:26 +00:00
float getCompressFraction(void);
float getHoldbackCompressFraction(void);
float getAngle(void);
float getHoldbackAngle(void);
float getLaunchbarPos(int i);
float getHoldbackPos(int j);
2005-02-17 10:37:26 +00:00
private:
float _launchbar_mount[3];
float _holdback_mount[3];
float _length;
float _holdback_length;
float _down_ang;
float _up_ang;
float _ang;
float _h_ang;
2005-02-17 10:37:26 +00:00
float _extension;
float _launchbar_force[3];
float _holdback_force[3];
2005-02-17 10:37:26 +00:00
float _frac;
float _h_frac;
2005-02-17 10:37:26 +00:00
float _pos_on_cat;
bool _launch_cmd;
bool _strop;
2005-02-17 10:37:26 +00:00
double _global_ground[4];
LBState _state;
};
}; // namespace yasim
#endif // _LAUNCHBAR_HPP