/*****************************************************************************
 * $Id: game_pony_craft.hh,v 1.17 2006/08/21 23:48:18 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Craft derivative class.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#if COMPILING_GAME_PONY
#ifndef GAME_PONY_CRAFT_HH
#define GAME_PONY_CRAFT_HH 1

#include "eng_dyna_part.hh"

////////////////////////////////////////////////////////////////////////////////
/// @brief Craft F-14 Tomcat class.
class CraftF14Tomcat : public Craft
{
private:
	PREVENT_COPYING(CraftF14Tomcat)
	typedef Craft Parent;

public:
					CraftF14Tomcat( QuadrantPtrc q, const Position& pos, const vector<string>& fnameModelVec );
					~CraftF14Tomcat();
    void            Reset( void );
	const string	GetName( void ) { return string("CraftF14Tomcat"); }
	int				Animate( void );
    void            RetractLandingGears( void );
    void            ExtendLandingGears( void );
    void            ToggleLandingGears( void )
    {
        if ( mGearState == eGear_UP )
            mGearState = eGear_DOWN;
        else if ( mGearState == eGear_DOWN )
            mGearState = eGear_UP;
    }

private:
    void            SaveLocalVertexsNormals( vector<LocalVertex>& savedLocalVertexs /*OUT*/, vector<pair<Normal,Nix> >& savedLocalNormals /*OUT*/, const vector<Vix>& vixs );
	bool			AdjustWings( void );
    void            AdjustWings2( const fp deg );
	bool			AdjustGloveVanes( const fp degSweep );
    bool            AdjustTailplanes( const fp degSweep );
    bool            AdjustGears( void );
    void            AdjustGears2( const fp deg );

	void SetVertexCnt( uint vcnt ) { }				// OBJECT NOP
	void SetWorldVertexs( WorldVertex* wv ) { }		// OBJECT NOP

private:
	fp                  mDegSweep;						///< current wing sweep (degrees)
	fp                  mDegGloveVanes;
	fp                  mDegGears;
	uint                mAdjustWingsMilsec;             ///< last time when wings were adjusted
	uint                mAdjustGearsMilsec;             ///< last time when wings were adjusted
    enum eGear { eGear_DOWN, eGear_UP };
    eGear               mGearState;
    MeshPart            mPartLeftWing;
    MeshPart            mPartRightWing;
    MeshPart            mPartLeftGloveVane;
    MeshPart            mPartRightGloveVane;
    MeshPart            mPartLeftTailplane;
    MeshPart            mPartRightTailplane;
    MeshPart            mPartFrontGear;
    MeshPart            mPartLeftGear;
    MeshPart            mPartRightGear;
};

#endif // GAME_PONY_CRAFT_HH
#endif // COMPILING_GAME_PONY
