How to destroy a joint

Ultima2876

15-12-2008 13:29:44

Hi All,

I've got a bit of a problem with destroying joints. I don't know how to do it, and can't find any information anywhere. What I'm trying to do is make an object grab and pull another by creating a ball and socket joint between them, then destroying it when the player drops the object.

I've tried just using the "delete" keyword, but this generates a "priveleged instruction" exception and crashes the program. Anyone know how to destroy a joint?

Thanks :)

Chulein

24-02-2009 09:25:51

Im using c# and Mogrenewt.
This is how i solve your problem:
It should be similar in C++:



MogreNewt.Joint joint;

//Create the joint.
joint = new MogreNewt.BasicJoints.BallAndSocket(mOgreMain.m_World, child, parent, positon);

//To Detach this joint
joint.Dispose();