Change the distance between objects in RevoluteJoint!

Hello There,

I've 2 objects, one is kinematic and the other one is dynamic. I bind them using a revolute joint. Kinematic body rotates around itself so causes the other dynamic body to rotate around itself as well, think it as moon rotating around the earth.

In that condition, I want to narrow the distance between those 2 objects so the dynamic body gets closer to the kinematic one. Tough I don't see any method or property in revolutejoint class, maybe there is an easy way to do this? So far, theorically, I see that I can calculate the distance and angle between those 2 objects, drop the joint, narrow the distance considering the angle and than re-create the joint to solve this issue though didn't give it a try.

Any help will be much appreciated?

Thanks,

Özden
I have found the method of destroying and recreating joints like you suggest to be surprisingly successful. As long as you are not changing the distance a whole lot, I would definitely suggest giving it a try.
Thanks, I'll probably go that way and will ask further if I see any problem... 😉

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