#pragma once

#include "dllinterface.h"
#include <d3dx9.h>

class DXFUNCTIONS_API PhysicalBody
{
	float m_Mass;

	float m_dTime;

	D3DXVECTOR3 m_Position;
	//D3DXVECTOR3 m_Rotation;
	D3DXMATRIX m_Orientation;

	D3DXVECTOR3 m_PositionVelocity;
	//D3DXVECTOR3 m_AngularMomentum;
	D3DXVECTOR3	m_AngularVelocity;

	//D3DXVECTOR3 m_Force;
	//D3DXVECTOR3 m_Torque;

public:
	PhysicalBody(float mass,D3DXVECTOR3 position,D3DXMATRIX orientation);
	~PhysicalBody(void);

	void ApplyPositionVelocity(D3DXVECTOR3 posvel);
	void ApplyAngularVelocity(D3DXVECTOR3 angvel);
	void ApplyVelocityAtPosition(D3DXVECTOR3 vel,D3DXVECTOR3 pos);
	
	void ApplyForce(D3DXVECTOR3 force);
	void ApplyTorque(D3DXVECTOR3 torque);
	void ApplyForceAtPosition(D3DXVECTOR3 force,D3DXVECTOR3 pos);

	void Move(float dTime);

	D3DXVECTOR3 GetPosition(void){return m_Position;}
//	D3DXVECTOR3 GetRotation(void){return m_Rotation;}
	D3DXMATRIX GetOrientation(void){return m_Orientation;}

	D3DXVECTOR3 GetPositionVelocity(void){return m_PositionVelocity;}
//	D3DXVECTOR3 GetRotationVelocity(void){return m_RotationVelocity;}
	D3DXVECTOR3 GetAngularVelocity(void){return m_AngularVelocity;}

	void SetPositionVelocity(D3DXVECTOR3 vel){m_PositionVelocity = vel;}
	void SetAngularVelocity(D3DXVECTOR3 vel){m_AngularVelocity = vel;}
};

