Remove Joints

Similar to the problem I have with removing bodies is remoing joints:

Code:
         if(joint != null)
         {
            var test:b2Vec2 = joint.GetReactionForce(0.1);
            if( test.Length() > 1000){
               global.world.DestroyJoint(joint);
               joint = null;
            }
         }


The joint simply isn't removed and nothing happens. "joint" is the reference returned when I created the joint (return CreateJoint(jointDef) as b2RevoluteJoint;)
The first thing that came to mind is that maybe the program isn't making it into that inner if statement. Set a breakpoint on the DestroyJoint statement and check. If it does make it in there, you can then step into DestroyJoint and see what's happening.
Thanks again Backbuffer!

Unfortunately, I've already thought of that. It does trigger the breakpoint, and stepping into it leads somewhere that steps into something else... so I hoped someone could just tell me.
Probably unrelated, but GetReactionForce wants the inverse time step, so 0.1 would suggest a time step of 10 seconds, so I am surprised DestroyJoint is ever called.
The value I passed was just for testing. If it worked I would calculate it from the time step.
Before I posted the first time I had already stepped through it. It is triggered, then it goes into the box2d code, which starts to get hairy. Ultimately, the joint is not removed and nothing happens -the joint still functions normally.

I will try searching through the whole joint list and removing manually. I'll let you know how it goes.
Not much interest in this, but in case anyone ever has the same problem.

You have to remove the joint from the joint list in the body it is attached to.
A.Russell wrote:
You have to remove the joint from the joint list in the body it is attached to.

You shouldn't have to... DestroyJoint is meant to handle all that. Sounds like it's a bug in the code. But it's not going to generate much interest when we are teetering on the brink of a new release from skatehead, which will almost certainly have the bug fixed (and different ones in it's place).
Quote:
You have to remove the joint from the joint list in the body it is attached to.


Sorry to bump an old thread. I'm trying to delete a joint and having no success. Would somebody be kind enough to clarify how to remove a joint from the list in the body?

Cheers

Original thread: https://box2d.org/forum/viewtopic.php?t=668