#ifndef CAMERA_H
#define CAMERA_H

#include <math.h>

//! OpenGL helper class
/** 
 * Camera representation for OpenGL.
 *
 * This class provides the basic functionality for an OpenGL camera placed on 
 * a sphere around a certain point of interest.
 */
class Camera
{
public:
	Camera(double polar=0.0, double azimut=0.0, double distance=1.0);
	~Camera(void);

	void setup(void);

	void setPolar(double polar);
	void setAzimut(double azimut);
	void setLookAt(int i, double pos) { m_lookAt[i] = pos; update(); };
	void setDistance(double distance);

	double polar(void) { return m_polar; };
	double azimut(void) { return m_azimut; };
	double position(int i) { return m_position[i]; };
	double lookAt(int i) { return m_lookAt[i]; };
	double distance(void) { return m_distance; };

protected:
	void update(void);

	double m_polar;         //!< vertical angle
	double m_azimut;        //!< horizontal angle
	double m_distance;      //!< camera distance to viewpoint

	double m_position[3];   //!< camera position
	double m_lookAt[3];     //!< viewpoint
};

#endif // CAMERA_H
