| 1 | // net_fdm_mini.hxx -- defines a simple subset I/O interface to the flight |
| 2 | // dynamics model variables |
| 3 | // |
| 4 | // Written by Curtis Olson - http://www.flightgear.org/~curt |
| 5 | // Started January 2002. |
| 6 | // |
| 7 | // This file is in the Public Domain, and comes with no warranty. |
| 8 | // |
| 9 | // $Id$ |
| 10 | |
| 11 | |
| 12 | #ifndef _NET_FDM_MINI_HXX |
| 13 | #define _NET_FDM_MINI_HXX |
| 14 | |
| 15 | |
| 16 | #ifndef __cplusplus |
| 17 | # error This library requires C++ |
| 18 | #endif |
| 19 | |
| 20 | #include <simgear/misc/stdint.hxx> |
| 21 | |
| 22 | // NOTE: this file defines an external interface structure. Due to |
| 23 | // variability between platforms and architectures, we only used fixed |
| 24 | // length types here. Specifically, integer types can vary in length. |
| 25 | // I am not aware of any platforms that don't use 4 bytes for float |
| 26 | // and 8 bytes for double. |
| 27 | |
| 28 | |
| 29 | const uint32_t FG_NET_FDM_MINI_VERSION = 2; |
| 30 | |
| 31 | |
| 32 | // Define a structure containing the top level flight dynamics model |
| 33 | // parameters |
| 34 | |
| 35 | class FGNetMiniFDM { |
| 36 | |
| 37 | public: |
| 38 | |
| 39 | enum { |
| 40 | FG_MAX_ENGINES = 4, |
| 41 | FG_MAX_WHEELS = 3, |
| 42 | FG_MAX_TANKS = 4 |
| 43 | }; |
| 44 | |
| 45 | uint32_t version; // increment when data values change |
| 46 | |
| 47 | // Positions |
| 48 | double longitude; // geodetic (radians) |
| 49 | double latitude; // geodetic (radians) |
| 50 | double altitude; // above sea level (meters) |
| 51 | double agl; // above ground level (meters) |
| 52 | double phi; // roll (radians) |
| 53 | double theta; // pitch (radians) |
| 54 | double psi; // yaw or true heading (radians) |
| 55 | |
| 56 | // Velocities |
| 57 | double vcas; |
| 58 | double climb_rate; // feet per second |
| 59 | |
| 60 | // Consumables |
| 61 | uint32_t num_tanks; // Max number of fuel tanks |
| 62 | double fuel_quantity[FG_MAX_TANKS]; |
| 63 | |
| 64 | // Environment |
| 65 | uint32_t cur_time; // current unix time |
| 66 | int32_t warp; // offset in seconds to unix time |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | #endif // _NET_FDM_MINI_HXX |