/*****************************************************************************
 * $Id: mod_pony_buildings.hh,v 1.1 2006/11/24 21:56: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_MODULE_PONY
#ifndef MOD_PONY_BUILDINGS_HH
#define MOD_PONY_BUILDINGS_HH 1

#include "eng_polygon.hh"

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

public:
						Runway( QuadrantPtrConst q, const Position& pos );
						Runway( QuadrantPtrConst 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( QuadrantPtrConst 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 // MOD_PONY_BUILDINGS_HH
#endif // COMPILING_MODULE_PONY
