1 /*****************************************************************************
2  * $LastChangedDate: 2009-11-22 22:39:11 -0500 (Sun, 22 Nov 2009) $
3  * @file
4  * @author  Jim E. Brooks  http://www.palomino3d.org
5  * @brief   Aircraft specifications.
6  *//*
7  * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
8  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
9  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
10  *****************************************************************************/
11 
12 #ifndef PHYSICS_AIRCRAFT_SPECS_HH
13 #define PHYSICS_AIRCRAFT_SPECS_HH 1
14 
15 #include "object/module.hh"
16 #include "object/rotation_list.hh"
17 using namespace object;
18 
19 namespace physics {
20 
21 ////////////////////////////////////////////////////////////////////////////////
22 /// @brief Specifications/characteristics of an Aircraft.
23 ///
24 class AircraftSpecs
25 {
26 COPYABLE(AircraftSpecs)
27 public:
28             AircraftSpecs( void );
29     void    ReadSpecsFromConfFile( const string& confTxtFilename );
30     enum eEngineType { eEngineType_PROPELLER, eEngineType_JET, eEngineType_ROCKET };
31 
32 private:
33     void    Reset( void );
34 
35 public:
36     // Mass:
37     Kilogram        mMass;
38 
39     // Thrust:
40     Newton1         mMaxThrustMag;      ///< magnitude
41     eEngineType     mEngineType;
42 
43     // Drag:
44     fp              mDragAofALimit;     ///< parameters of drag formula
45     Degree          mDragAofADegree;
46 
47     // Lift:
48     SpeedKPH        mLiftoffSpeed;
49     Degree          mMaxAofA;
50     fp              mRangeOfLiftFactor;
51     fp              mRangeOfLiftFactorSpeed;
52     fp              mRangeOfLiftFactorAofA;
53 
54     // Turning:
55     Degree          mTurnDegreeLow;     ///< degree when banked turn is indicated
56     Degree          mTurnDegreeHigh;
57 
58     // Airframe:
59     Meter           mLength;
60     Meter           mHeight;
61     SpeedKPH        mMaxSpeed;
62     SpeedKPH        mStallSpeed;
63     Degree          mRollRate;          ///< degree/sec
64     Degree          mPitchRate;         ///< degree/sec
65     Degree          mYawRate;           ///< degree/sec
66 
67     // 3D model:
68     string          mModelFile;             ///< .ac file typically
69     fp              mModelScale;
70     GeoVertex       mModelOffset;           ///< [METERS] to adjust center of 3D model
71     Meter           mModelOffsetGear;       ///< [METERS] to adjust altitude so that landing gears sits on runway
72     RotationList    mModelRotationList;     ///< orientation of 3D model
73     string          mModelShader;           ///< name of shader
74 
75     // Control surfaces:
76     Vector3         mAileronOffset;         ///< local 3D space
77     Vector3         mElevatorOffset;        ///< local 3D space
78     Vector3         mRudderOffset;          ///< local 3D space
79     Vector3         mRudder2Offset;         ///< N/A if isn't twin-tail
80     Radian          mAileronROF;            ///< "radian of freedom"
81     Radian          mElevatorROF;           ///< "radian of freedom"
82     Radian          mRudderROF;             ///< "radian of freedom"
83     Radian          mAileronAngle;          ///< jets have swept wings
84     Radian          mRudderAngle;           ///< jets have swept rudders
85 };
86 
87 } // namespace physics
88 
89 #endif // PHYSICS_AIRCRAFT_SPECS_HH
90