#include "DefaultMotionState.h"
#include "BulletCLIMath.h"

namespace BulletCLI
{
    DefaultMotionState::DefaultMotionState()
	{
        this->m_p=new ::btDefaultMotionState();
	}
	
	DefaultMotionState::DefaultMotionState(Matrix statTransform,Matrix centerOfMassOffset)
	{
        this->m_statTransform=BulletCLI::XMatrixToBTTransform(statTransform);
        this->m_centerOfMassOffset=BulletCLI::XMatrixToBTTransform(centerOfMassOffset);
        this->m_p=new ::btDefaultMotionState(*m_statTransform,*m_centerOfMassOffset);
	}
	DefaultMotionState::~DefaultMotionState()
	{
		this->!DefaultMotionState();
	}
	DefaultMotionState::!DefaultMotionState()
	{
        SAFE_DELETE(this->m_statTransform);
        SAFE_DELETE(this->m_centerOfMassOffset);
		delete this->m_p;
	}
}