#include "IPhysicsJoint.h"

NewtonWorld* IPhysicsJoint::m_world;

IPhysicsJoint::IPhysicsJoint()
{

}

IPhysicsJoint::~IPhysicsJoint()
{
	if(m_joint)
	{
		NewtonJointSetDestructor( m_joint, NULL );
		NewtonDestroyJoint( m_world, m_joint );
	}
}

NewtonJoint* IPhysicsJoint::getJoint()
{
	return m_joint;
}

int IPhysicsJoint::getCollisionState()
{
	return NewtonJointGetCollisionState(m_joint);
}

void IPhysicsJoint::setCollisionState(int state)
{
	NewtonJointSetCollisionState(m_joint,state);
}

f32 IPhysicsJoint::getStiffness()
{
	return NewtonJointGetStiffness(m_joint);
}

void IPhysicsJoint::setStiffness(f32 stiffness)
{
	NewtonJointSetStiffness(m_joint,stiffness);
}
