/*****************************************************************************
 * $Id: game_base_chase_plane.hh,v 1.10 2006/08/03 02:17:21 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	ChasePlane classes.
 * @remarks
 *//*
 * 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
#ifndef GAME_BASE_CHASE_PLANE_HH
#define GAME_BASE_CHASE_PLANE_HH 1

////////////////////////////////////////////////////////////////////////////////
/// Every Craft object has its own ChasePlane view.
class ChasePlaneCraft : public ChasePlane
{
private:
	PREVENT_COPYING(ChasePlaneCraft)
	typedef ChasePlane Parent;

public:
	explicit		ChasePlaneCraft( const Dyna& owner );
					~ChasePlaneCraft() { }
	void			Reset( void );
	int				Chase( void );
	void			IncRotate( uint axis, int dir );
	void			IncDistance( int dir );
	void			SetDistance( fp dist );
	fp				GetDistance( void );

private:
	void			ZoomOutFromTarget( void );
	void			Save( void );
	void			RestoreIfInvalid( void );
	void			Rotate( uint axis, fp deg );
	void			Translate( uint axis, fp inc );

private:
	/// distance from chase-plane to its target
	fp				mDist;
	/// chase-plane matrix
	MatrixExt		mXm;

	static MatrixExt    mXmSaved;
	static fp           mDistSaved;
};

#endif // GAME_BASE_CHASE_PLANE_HH
#endif // COMPILING_GAME
