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

	Fog.h

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

	Author:	Jerome Bignon

	Date:	20/04/99

	Revision History

	when		who			what & why
	=========== ===========	=============================================================
	7/6/99		Pierre-E	modification of the identifier in the methods SegmentFilter
							and DirectionFilter: filterOut --> inOutFilter
****************************************************************************************/

#ifndef __Fog__
#define __Fog__  

#if CP_PRAGMA_ONCE
#pragma once
#endif

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

// Define the Fog CLSID ( see the FogDef.h file to get the R_CLSID_Fog value )

extern const MCGUID CLSID_Fog;

// Data storage of our extension :
struct FogData
{
  TMCColorRGBA	fColor;      // "Color" of the fog
  real			fZmax;       // Minimum altitude of the fog
  real			fZmin;       // Maximum altitude of the fog
  real			fVisibility; // Distance of Visibility
};
 
// Fog Object :

class Fog : public TBasicAtmosphere
{
public :  
  Fog();

  STANDARD_RELEASE;

  // IExDataExchanger methods :
  virtual void*		MCCOMAPI	GetExtensionDataBuffer();
  virtual int32		MCCOMAPI	GetParamsBufferSize		() const	{ return sizeof(fData);}
  
  // I3DExAtmosphericShader methods
  virtual MCCOMErr	MCCOMAPI	SegmentFilter(TVector3& beg,TVector3& end, TMCColorRGB& inOutFilter, boolean indirectLight, boolean isShadowCasting, boolean isSunLightShadowCasting);
  virtual MCCOMErr	MCCOMAPI	DirectionFilter(TVector3& origin, TVector3& direction, TMCColorRGB& inOutFilter, boolean indirectLight);

protected :
  FogData fData;      // Atmospheric Data
};

#endif
