#ifndef CPHYSICS_HINGE_H
#define CPHYSICS_HINGE_H

#include "PhysicsGlobal.h"
#include "SPhysicsStructs.h"
#include "IPhysicsJoint.h"

class CPhysicsHinge : public IPhysicsJoint
{
public:
	CPhysicsHinge();
	~CPhysicsHinge();
	
	void init(NewtonWorld* nWorld, SPhysicsHingeJoint *jnt);
	void setUserCallback(NewtonBallCallBack callback);
	
	vector3df getForce();
	f32 getAngle();
	f32 getOmega();
	NewtonJoint* getJoint();

private:
	static unsigned _cdecl hingeCallback (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);

	static f32 m_maxAngle;
	static f32 m_minAngle;
	static vector3df m_breakForce;
};

#endif