/*****************************************************************************
 * $Id: game_pony_buildings.hh,v 1.21 2006/08/10 03:18:58 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Buildings and other man-made edifices.
 *//*
 * 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_BUILDINGS_HH
#define GAME_PONY_BUILDINGS_HH 1

#include "eng_polygon.hh"

////////////////////////////////////////////////////////////////////////////////
// Runway
class Runway : public FixedMesh
{
private:
	PREVENT_COPYING(Runway)
	typedef FixedMesh Parent;

public:
						Runway( QuadrantPtrc q, const Position& pos );
						Runway( QuadrantPtrc q, const Position& pos, fp width, fp length );
						~Runway();
	void				FinalConstruction( void ) { CalcRadius(); }
	bool				Reproducible( void ) { return false; }  // must always be present
    int                 Visible( void ) { return VisibleSimple(); }
	void				Draw( void );
	const string		GetName( void ) { return string("Runway"); }
	uint				GetVertexCnt( void ) { return 4; }
	const WorldVertex*	GetWorldVertexs( void ) { return mWorldVertexs; } ///< pre-calc by constructor
    fp                  Width( void )  { return mWidth; }
    fp                  Length( void ) { return mLength; }
    static fp           DefaultWidth( void ) { return msDefaultWidth; }
    static fp           DefaultLength( void ) { return msDefaultLength; }
    bool                IfOverlaps( const Posrad& posrad ) { return mRectEnlarged.IfOverlaps(posrad); }

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

private:
	void				Init( QuadrantPtrc q, const Position& pos, fp width, fp height );

	WorldVertex			mWorldVertexs[4];
	EyeVertex			mEyeVertexs[4];
    RectXZ              mRectEnlarged; // enlarged rectangle to prevent objects on runway
    fp                  mWidth;
    fp                  mLength;
    static Poly16tex    msPoly16tex[];
    static Poly16       msPoly16[];
    static fp           msDefaultWidth;
    static fp           msDefaultLength;
};

#endif // GAME_PONY_BUILDINGS_HH
#endif // COMPILING_GAME_PONY
