///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ZCamera Class
///
///		- Camera class
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////






#ifndef __ZOOCAMERA_H__
#define __ZOOCAMERA_H__



#include	"..\Basic\ZooStd.h"
#include	"..\Scene Graph\ZooNodeGraph.h"









///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ZCamera Class
///
///		- Classe des caméras
///		- target = axe de visée (normal), ou angles de visée (VizThéta, VizPhi)
///		- Field of vision en "degrés" !!!
///		- Znear, Zfar
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class ZCamera : public ZNodeGraph
{

public:
	
	float		fov;							// field of view
	float		Znear, Zfar;					// Znear and Zfar for clipping
	float		Zfog;

	ZMatrix		cameraMatx;						// camera matrix : rotation, translation
	ZMatrix		visionMatx;						// vision matrix : perspective

	int			width, height;
	int			dx, dy;

	ZVector3	RealWorldAngles;
	ZVector3	RealWorldPos;
	ZMatrix		RealWorldMat;

	
	///////////////////////////////////////////////////////////////////////////
	/// Constructor	& Destructor		      								///
	///////////////////////////////////////////////////////////////////////////
	ZCamera(int s3d);
	~ZCamera();


	///////////////////////////////////////////////////////////////////////////
	/// Set the components of the camera      								///
	///////////////////////////////////////////////////////////////////////////
	void SetCamera(float nfov, float nZnear, float nZfar);


	///////////////////////////////////////////////////////////////////////////
	/// Compute the matrix of camera space    								///
	///////////////////////////////////////////////////////////////////////////
	void ComputeMatrix();
	void ComputeMatrixOrtho();
};




///////////////////////////////////////////////////////////////////////////
/// Set the components of the camera      								///
///////////////////////////////////////////////////////////////////////////
inline void ZCamera::SetCamera(float nfov, float nZnear, float nZfar)
{
	fov			= nfov;
	Znear		= nZnear;
	Zfar		= nZfar;
}






#endif