#include "KinectSkeleton.h"


//----------------------------------------------------------------------------
KinectSkeleton::KinectSkeleton()
{
	VF3 Pos(0.f, 0.f, 0.f);
	for ( unsigned int i = 0; i < SKEL_COUNT; i++ )
	{
		m_JointPositions1.push_back(Pos);
		m_JointPositions2.push_back(Pos);
	}
}


//----------------------------------------------------------------------------
KinectSkeleton::~KinectSkeleton()
{
}


//----------------------------------------------------------------------------
void KinectSkeleton::SetJoint(JointTypes Joint, VF3 Pos, int idx)
{
	switch(idx)
	{
	case 0:
		m_JointPositions1[Joint] = Pos;
		break;
	case 1:
		m_JointPositions2[Joint] = Pos;
	}
}


//----------------------------------------------------------------------------
void KinectSkeleton::SetJoint(JointTypes Joint, float PosX, float PosY, float PosZ, int idx)
{
	switch(idx)
	{
		case 0:
			m_JointPositions1[Joint][0] = PosX;
			m_JointPositions1[Joint][1] = PosY;
			m_JointPositions1[Joint][2] = PosZ;
			break;
		case 1:
			m_JointPositions2[Joint][0] = PosX;
			m_JointPositions2[Joint][1] = PosY;
			m_JointPositions2[Joint][2] = PosZ;

	}
}


//----------------------------------------------------------------------------
VF3 KinectSkeleton::GetJoint(JointTypes Joint, int idx) const
{
	switch(idx)
	{
	case 0:
		return m_JointPositions1[Joint];
		break;
	default:
		return m_JointPositions2[Joint];
	}
}


//----------------------------------------------------------------------------
void KinectSkeleton::SetTrackingState(JointTypes Joint, short value, int idx)
{
	m_TrackingState[Joint + idx * KinectSkeleton::SKEL_COUNT] = value; 
}


//----------------------------------------------------------------------------
short KinectSkeleton::GetTrackingState(JointTypes Joint, int idx) const
{
	return m_TrackingState[Joint + idx * KinectSkeleton::SKEL_COUNT]; 
}
