#ifndef VIEWER_H
#define VIEWER_H


#include "./renderer/render.h"
#include "./math/Mathematics.h"
#include "./uiSupport/controls.h"
#include <cassert>

using namespace GEOMETRY;
using namespace ANALYTICAL_GEOMETRY;

/// Auxiliary structure for 3rd person camera mode.
/**
*	Auxiliary structure for 3rd person camera implemented in class BasicViewer. Contains informations about center point, max and min camera zoom and angle.
**/
class Observer
{
public:
	float nearCameraLimit;	/**<max zoom camera limit*/
	float farCameraLimit;	/**<min zoom camera limit*/
	float maxVerticalAngle;	/**<max vertical camera angle limit*/
	float minVerticalAngle;	/**<min vertical camera angle limit*/
	Point_3<float> cameraPivot;	/**<central point - camera rotates around this point. */

	void zoomCamera( float zoom, Camera<float>& camera ); /**<zoom given camera */
	void rotateCamera( float axisX, float axisY, Camera<float>& camera );	/**<rotates camera around camera right vector angle axisX and vertical axis axisY */
	void calibrateCamera( Camera<float>& camera );	/**<clamp camera position into selected limits*/

	Observer( void );
};

/// Third person camera mode.
/**
*	Camera mode, where central point is observed and camera rotates around this point.
**/
class BasicViewer
{
public:
	Camera<float> camera;	///camera to work with
	Observer observerData;	///camera limits
	
	virtual void handleKeyboard( Keyboard &keyboard );
	virtual void handleMouse( Mouse &mouse );
	
	BasicViewer( void );
};



#endif