///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ZAnim Class
///
///		- Animation Class (position et rotation)
///		- KeyFrame Animation!!
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////









#ifndef __ZOOANIM_H__
#define __ZOOANIM_H__



#include	"..\Basic\ZooStd.h"
#include	"..\Datas\ZooMesh.h"
#include	"..\Scene Graph\ZooNodeGraph.h"















struct ZkeyPos
{
	int			key;
	ZVector3	pos;
};

struct ZkeyRot
{
	int			key;
	ZQuat		rot;
};




///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ZAnim Class
///
///		- Classe des animations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class ZAnim : public ZNodeGraph
{
private:




public:
   	
	int				scene3D;
	int				length;
	vector<ZkeyPos> listPos;		// FUSIONNER LES DEUX !!!!
	vector<ZkeyRot>	listRot;

	int				minKeyPos, maxKeyPos;
	int				minKeyRot, maxKeyRot;



	///////////////////////////////////////////////////////////////////////////
	/// Constructor					 										///
	///////////////////////////////////////////////////////////////////////////
	ZAnim(int s3d);
	~ZAnim();


	///////////////////////////////////////////////////////////////////////////
	/// Length methods				 										///
	///////////////////////////////////////////////////////////////////////////
	bool setLength(int newLength);
	int	 getLength();


	///////////////////////////////////////////////////////////////////////////
	/// Add keys in the lists		 										///
	///////////////////////////////////////////////////////////////////////////
	bool addKeyPos(int key, const ZVector3 &pos);
	bool addKeyRot(int key, const ZQuat	 &rot);


	///////////////////////////////////////////////////////////////////////////
	/// put the animation key (already defined)								///
	///////////////////////////////////////////////////////////////////////////
	bool putAnimKey(ZPRS *prs, float frame, int flag);

	bool putAnimBoneKey(ZPRS *prs, float frame, int flag,ZMesh *topo);


	///////////////////////////////////////////////////////////////////////////
	/// Interpolate between two animation keys								///
	///////////////////////////////////////////////////////////////////////////
	bool putAnimKeyInterp(ZPRS *prs, float frame0, float frame1, float rate, int flag);
};



///////////////////////////////////////////////////////////////////////////
/// Set the length				 										///
///////////////////////////////////////////////////////////////////////////
inline bool ZAnim::setLength(int newLength)
{
	if(newLength < length)	return false;

	length = newLength;
	
	return true;
}



///////////////////////////////////////////////////////////////////////////
/// Get the length				 										///
///////////////////////////////////////////////////////////////////////////
inline int ZAnim::getLength()
{
	return length;
}






#endif