/****************************************************************************************

	COMBack.h

	Copyright (c)1990 - 1999 MetaCreations. All rights reserved.

	Author:	Jerome Bignon

	Date:	06/21/99

	Revision History

	when		who			what & why
	=========== ===========	=============================================================

****************************************************************************************/

#ifndef __BACK__
#define __BACK__  

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include	"BasicEnvironment.h"
#include	"APITypes.h"
#include	"MCColorRGBA.h"
#include	"BackDef.h"

// Define the Back CLSID ( see the BackDef.h file to get the R_CLSID_Back value )

extern const MCGUID CLSID_Back;
                  
struct BackData
{
	TMCColorRGBA fSunColor;
	real   fSunDiameter;
	real   fWestDirection;
	TMCColorRGBA fZenithColor;
	TMCColorRGBA fWestColor;
	TMCColorRGBA fEastColor;
	TMCColorRGBA fEarthColor;
};

 
// Sunset Object :
class Back : public TBasicBackground
{
	public :  
		Back();
		STANDARD_RELEASE;
    
		// IExDataExchanger methods :
		virtual void*				MCCOMAPI     GetExtensionDataBuffer();
		virtual int32				MCCOMAPI	 GetParamsBufferSize		() const	{ return sizeof(fData);}
		virtual MCCOMErr			MCCOMAPI     ExtensionDataChanged();
		virtual int16				MCCOMAPI     GetResID();
  
		// I3DExBackgroundShader methods
		virtual MCCOMErr	MCCOMAPI     GetBackgroundColor(TMCColorRGB& color,boolean& fullAreaDone,const TVector3& direction);
  
	private :
		BackData    fData;			// Sunset Data
		TVector3	fWestVector;	// Vector which gives the West
		real		fSunLimit;		// Limit (cosinus) of the Sun Diameter
};
                          

#endif

