]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Glue.hpp
Updates to the controls properties tree. This is a major update so there may be one...
[flightgear.git] / src / FDM / YASim / Glue.hpp
1 #ifndef _GLUE_HPP
2 #define _GLUE_HPP
3
4 #include "BodyEnvironment.hpp"
5
6 namespace yasim {
7
8 // The XYZ coordinate system has Z as the earth's axis, the Y axis
9 // pointing out the equator at zero longitude, and the X axis pointing
10 // out the middle of the western hemisphere.
11 class Glue {
12 public:
13     static void calcAlphaBeta(State* s, float* alpha, float* beta);
14
15     // Calculates the instantaneous rotation velocities about each
16     // axis.
17     static void calcEulerRates(State* s,
18                                float* roll, float* pitch, float* hdg);
19
20     static void xyz2geoc(double* xyz,
21                          double* lat, double* lon, double* alt);
22     static void geoc2xyz(double lat, double lon, double alt,
23                          double* out);
24     static void xyz2geod(double* xyz,
25                          double* lat, double* lon, double* alt);
26     static void geod2xyz(double lat, double lon, double alt,
27                          double* out);
28
29     static double geod2geocLat(double lat);
30     static double geoc2geodLat(double lat);
31
32     // Returns a global to "local" (north, east, down) matrix.  Note
33     // that the latitude passed in is geoDETic.
34     static void xyz2nedMat(double lat, double lon, float* out);
35
36     // Conversion between a euler triplet and a matrix that transforms
37     // "local" (north/east/down) coordinates to the aircraft frame.
38     static void euler2orient(float roll, float pitch, float hdg,
39                              float* out);
40     static void orient2euler(float* o,
41                              float* roll, float* pitch, float* hdg);
42
43     // Returns a geodetic (i.e. gravitational, "level", etc...) "up"
44     // vector for the specified xyz position.
45     static void geodUp(double* pos, float* out);
46 };
47
48 }; // namespace yasim
49 #endif // _GLUE_HPP