//
// Asura_Animation_IK_Template.h
//
// Created by Richard Rice - 12/05/2008
// 
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_ANIMATION_IK_TEMPLATE_H__
#define __ASURA_ANIMATION_IK_TEMPLATE_H__
#ifdef ASURA_USE_ANIMATION_IK_SOLVER

#include "Core/Asura_Hash.h"
#include "Core/Asura_String.h"

class Asura_Animation_IK_Template_Chain;
class Asura_Animation_IK_Solver;
class Asura_Animation;
class Asura_Chunk_Stream;

class Asura_Animation_IK_Template
{
	friend class Asura_Animation_IK_Template_System;
	friend class Tools_Animation_IK_Template_System;
	friend class Asura_Chunk_IK_Template;
public :
	Asura_Animation_IK_Template(const char* szName);
	~Asura_Animation_IK_Template();

	Asura_Hash_ID GetHashID() const {return m_uHashID;}
	const char* GetName() const {return m_xName.GetString();}

	void SetupIKSolver(Asura_Animation_IK_Solver* pxSolver, const Asura_Animation* pxAnim) const;

	bool ReadFromChunkStream(Asura_Chunk_Stream& xStream);
	#ifdef ASURA_TOOLS
	void WriteToChunkStream(Asura_Chunk_Stream& xStream) const;
	#endif

private :
	Asura_Hash_ID m_uHashID;
	Asura_String m_xName;

	u_int m_uNumIKChains;
	Asura_Animation_IK_Template_Chain** m_ppxIKChains;

	Asura_Hash_ID m_uSkinID;//ID of the skin associated with this (for editing purposes mainly)
};




#endif //ASURA_USE_ANIMATION_IK_SOLVER
#endif //__ASURA_ANIMATION_IK_TEMPLATE_H__
