/*****************************************************************************
 * $Id: mod_base_chase_plane.hh,v 1.1 2006/11/24 21:56:57 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_MODULE
#ifndef MOD_BASE_CHASE_PLANE_HH
#define MOD_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, Degree 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 // MOD_BASE_CHASE_PLANE_HH
#endif // COMPILING_MODULE
