]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Hook.hpp
Add the missing carrier files.
[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 class 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 private:
48     float _pos[3];
49     float _length;
50     float _down_ang;
51     float _up_ang;
52     float _extension;
53     float _force[3];
54     float _frac;
55     bool _has_wire;
56
57     double _old_mount[3];
58     double _old_tip[3];
59
60     double _global_ground[4];
61 };
62
63 }; // namespace yasim
64 #endif // _HOOK_HPP