Пример #1
0
NewtonCustomJoint::~NewtonCustomJoint()
{
	//_ASSERTE (m_joint);
	
	//if the joint has user data it means the application is destroy the joint
	if (NewtonJointGetUserData (m_joint)) {
		// set the joint call to NULL to prevent infinite recursion 
		NewtonJointSetDestructor (m_joint, NULL);  

		// destroy this joint
		NewtonDestroyJoint(m_world, m_joint);
	}
}
Пример #2
0
CustomJoint::~CustomJoint()
{
	//dAssert (m_joint);
	
	//if the joint has user data it means the application is destroying the joint

// if there is a C destructor call it form here
	CustomJoint* const joint = (CustomJoint*) NewtonJointGetUserData (m_joint);  
	if (joint->m_userDestructor) {
		joint->m_userDestructor ((const NewtonUserJoint*) joint);
	}

//	if (NewtonJointGetUserData (m_joint)) {
	if (!m_autoDestroy) {
		// set the joint call to NULL to prevent infinite recursion 
		NewtonJointSetUserData (m_joint, NULL);  
		NewtonJointSetDestructor (m_joint, NULL);  

		// destroy this joint
		NewtonDestroyJoint(m_world, m_joint);
	}
}
	void Roket_PhysicsJointUniversal::destroy()
	{
		NewtonDestroyJoint(world, joint);
	}
	void Roket_PhysicsJointCorkscrew::destroy()
	{
		NewtonDestroyJoint(world, joint);
	}