]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Hook.hpp
latest updates from JSBSim
[flightgear.git] / src / FDM / YASim / Hook.hpp
1 #ifndef _HOOK_HPP
2 #define _HOOK_HPP
3
4 namespace yasim {
5
6 class Ground;
7 class RigidBody;
8 struct State;
9
10 // A landing hook has the following parameters:
11 //
12 // position: a point in the aircraft's local coordinate system where the
13 //     fully-extended wheel will be found.
14 //
15 class Hook {
16 public:
17     Hook();
18
19     // Externally set values
20     void setPosition(float* position);
21     void setLength(float length);
22     void setDownAngle(float ang);
23     void setUpAngle(float ang);
24     void setExtension(float extension);
25     void setGlobalGround(double *global_ground);
26
27     void getPosition(float* out);
28     float getLength(void);
29     float getDownAngle(void);
30     float getUpAngle(void);
31     float getExtension(void);
32
33     void getTipPosition(float* out);
34     void getTipGlobalPosition(State* s, double* out);
35
36     // Takes a velocity of the aircraft relative to ground, a rotation
37     // vector, and a ground plane (all specified in local coordinates)
38     // and make a force and point of application (i.e. ground contact)
39     // available via getForce().
40     void calcForce(Ground *g_cb, RigidBody* body, State* s, float* lv, float* lrot);
41
42     // Computed values: total force, weight-on-wheels (force normal to
43     // ground) and compression fraction.
44     void getForce(float* force, float* off);
45     float getCompressFraction(void);
46
47     float getAngle(void);
48     float getHookPos(int i);
49
50 private:
51     float _pos[3];
52     float _length;
53     float _down_ang;
54     float _up_ang;
55     float _ang;
56     float _extension;
57     float _force[3];
58     float _frac;
59     bool _has_wire;
60
61     double _old_mount[3];
62     double _old_tip[3];
63
64     double _global_ground[4];
65 };
66
67 }; // namespace yasim
68 #endif // _HOOK_HPP