// PlanetView.h: interface for the CPlanetView class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PLANETVIEW_H__DBAE1B36_9FF6_11D6_BF44_444553540000__INCLUDED_)
#define AFX_PLANETVIEW_H__DBAE1B36_9FF6_11D6_BF44_444553540000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>

class CPlanetView  
{
public:
	CPlanetView();
	virtual ~CPlanetView();

	void SetViewerPosition(double angle, double distance);
	void SetLightPosition(double angle);
	void Render(HBITMAP color, HBITMAP topography, double heightRange, HBITMAP canvas);

private:
	COLORREF GetIlluminatedColor(HBITMAP color, HBITMAP topography, double heightRange, double latitude, double longitude);
	COLORREF GetSurfaceColor(HBITMAP color, double latitude, double longitude);
	void GetSurfaceNormal(HBITMAP topography, double heightRange, double latitude, double longitude, double normal[3]);

	double m_viewerAngle;
	double m_viewerDistance;
	double m_lightAngle;

	const static double m_pi;
};

#endif // !defined(AFX_PLANETVIEW_H__DBAE1B36_9FF6_11D6_BF44_444553540000__INCLUDED_)
