/*****************************************************************************
 * $LastChangedDate: 2009-11-22 22:39:11 -0500 (Sun, 22 Nov 2009) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Aircraft specifications.
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef PHYSICS_AIRCRAFT_SPECS_HH
#define PHYSICS_AIRCRAFT_SPECS_HH 1

#include "object/module.hh"
#include "object/rotation_list.hh"
using namespace object;

namespace physics {

////////////////////////////////////////////////////////////////////////////////
/// @brief Specifications/characteristics of an Aircraft.
///
class AircraftSpecs
{
COPYABLE(AircraftSpecs)
public:
            AircraftSpecs( void );
    void    ReadSpecsFromConfFile( const string& confTxtFilename );
    enum eEngineType { eEngineType_PROPELLER, eEngineType_JET, eEngineType_ROCKET };

private:
    void    Reset( void );

public:
    // Mass:
    Kilogram        mMass;

    // Thrust:
    Newton1         mMaxThrustMag;      ///< magnitude
    eEngineType     mEngineType;

    // Drag:
    fp              mDragAofALimit;     ///< parameters of drag formula
    Degree          mDragAofADegree;

    // Lift:
    SpeedKPH        mLiftoffSpeed;
    Degree          mMaxAofA;
    fp              mRangeOfLiftFactor;
    fp              mRangeOfLiftFactorSpeed;
    fp              mRangeOfLiftFactorAofA;

    // Turning:
    Degree          mTurnDegreeLow;     ///< degree when banked turn is indicated
    Degree          mTurnDegreeHigh;

    // Airframe:
    Meter           mLength;
    Meter           mHeight;
    SpeedKPH        mMaxSpeed;
    SpeedKPH        mStallSpeed;
    Degree          mRollRate;          ///< degree/sec
    Degree          mPitchRate;         ///< degree/sec
    Degree          mYawRate;           ///< degree/sec

    // 3D model:
    string          mModelFile;             ///< .ac file typically
    fp              mModelScale;
    GeoVertex       mModelOffset;           ///< [METERS] to adjust center of 3D model
    Meter           mModelOffsetGear;       ///< [METERS] to adjust altitude so that landing gears sits on runway
    RotationList    mModelRotationList;     ///< orientation of 3D model
    string          mModelShader;           ///< name of shader

    // Control surfaces:
    Vector3         mAileronOffset;         ///< local 3D space
    Vector3         mElevatorOffset;        ///< local 3D space
    Vector3         mRudderOffset;          ///< local 3D space
    Vector3         mRudder2Offset;         ///< N/A if isn't twin-tail
    Radian          mAileronROF;            ///< "radian of freedom"
    Radian          mElevatorROF;           ///< "radian of freedom"
    Radian          mRudderROF;             ///< "radian of freedom"
    Radian          mAileronAngle;          ///< jets have swept wings
    Radian          mRudderAngle;           ///< jets have swept rudders
};

} // namespace physics

#endif // PHYSICS_AIRCRAFT_SPECS_HH
