[svn] / nytr / trunk / libnytrengine / Environment.h Repository:
ViewVC logotype

View of /nytr/trunk/libnytrengine/Environment.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 678 - (download) (as text) (annotate)
Sat Jan 12 07:18:19 2008 UTC (2 years, 7 months ago) by kouhei
File size: 1470 byte(s)
added libnytrengine. buildable
#ifndef _nytr_Environment_h_
#define _nytr_Environment_h_

#include "rndrcmn.h"
#include "SampleValue.h"

namespace nytr
{

//! environment interface
/*!
    Environment class handles estimation of radiance from non-hit rays.
 */
class Environment
{
public:
	//! D-tor
	virtual ~Environment();

	//! handle background
	virtual void handleBackground(SampleValue* pVal, const FVector3& vDir) = 0;
};

class Texture;
class EMMapping;

//! environment map impl.
class EnvironmentMap : public Environment
{
public:
	//! C-tor
	/*!
		@param pTex
			environment map texture.
			the texture should be binded to Scene class
		@param spEMM
			environment map mapping (made shared_ptr because it can be shared with IBL classes)
	 */
	EnvironmentMap(Texture* pTex, boost::shared_ptr<EMMapping> spEMM);

	//! D-tor
	virtual ~EnvironmentMap();

	void handleBackground(SampleValue* pVal, const FVector3& vDir);

	// ------ accessor methods ------
	const Texture* getpTexture() const
	{
		return m_pTexture;
	}
	
	Texture* getpTexture()
	{
		return m_pTexture;
	}

	const boost::shared_ptr<EMMapping>& getspEMM() const
	{
		return m_spEMM;
	}

	boost::shared_ptr<EMMapping>& getspEMM()
	{
		return m_spEMM;
	}

private:
	//! environment map texture
	Texture* m_pTexture;

	//! environment map mapping info.
	boost::shared_ptr<EMMapping> m_spEMM;
};

} // end of namespace nytr

#endif // _nytr_Environment_h_

admin
ViewVC Help
Powered by ViewVC 1.0.5