/*****************************************************************************
 * $Id: mod_pony_sky.hh,v 1.1 2006/11/24 21:56:58 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Sky 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_MODULE_PONY
#ifndef MOD_PONY_SKY_HH
#define MOD_PONY_SKY_HH 1

#include "mod_pony_cloud.hh"

////////////////////////////////////////////////////////////////////////////////
/// @brief Sky class.
class Sky : public Omni
{
private:
	PREVENT_COPYING(Sky)
	typedef Omni Parent;

public:
	explicit		Sky( QuadrantPtrConst q );
					~Sky();
	fp				GetDistance( void );
	void			FinalConstruction( void ) { }
	/// Sky is reproducible to regenerate the same clouds.
	bool			Reproducible( void ) { return true; }
	void			Draw( void );
	const string	GetName( void ) { return string("Sky"); }

protected:
	// Support for drawing Omnis only once per frame (TODO per-view).
	uint			GetFrameDrawn( void ) { return msFrameDrawn; }
	void			SetFrameDrawn( uint frame ) { msFrameDrawn = frame; }
	static uint		msFrameDrawn;

private:
    void            MakeClouds( void );
    void            MakeClouds( const Cloud::TypeCombo& cloudType, uint cloudCnt );
    void            DrawSkyCylinder( void );

    enum            { mSideCnt = 10 };  ///< must divide 360 evenly
	WorldVertex     mVg[mSideCnt+1];	///< ground-level : sideCnt PLUS 1
	WorldVertex     mVs[mSideCnt+1];	///< sky-level    : sideCnt PLUS 1
	EyeVertex       mPrevEye;
};

#endif // MOD_PONY_SKY_HH
#endif // COMPILING_MODULE_PONY
