b2RopeJoint vs b2DistanceJoint

Hi!

I've just updated to the SVN version and noticed that there is a new b2RopeJoint. Cool! Just what I needed a few days ago 😉.

I solved it with a similar code, but instead of creating a new joint type I modified the b2Distance Joint adding a bool member (isRope) that, when true, enforces the constraint only if the distance is greater than the configured.

This gives the same functionality than the b2RopeJoint, but better, because you have the frequencyHz and the dampingRatio options.

What do you think? Is this a good idea? Or is there a reason why I shouldn't do this? The fact is that my simulation seems to work pretty well...

Thank you in advance.
--
Rodrigo
b2RopeJoint is new and experimental. b2DistanceJoint can do plenty of jobs pretty well, if you don't need any of the functionality that is only in a b2RopeJoint.
What I mean is that the b2JoinRope looks some like a stripped down version of b2DistanceJoint but with the rope-like conditions added.
Maybe you can add the rope functionality to the b2DistanceJoint just by adding two member variables:
Code:
bool m_isRope;
b2LimitState m_state;

and a few ifs here and there.

Or maybe I'm missing something...

Regards.
--
Rodrigo
I recall trying the same thing as you, and it did not work in some cases, sorry I can't remember exactly what those cases were. Did you try eg. making chains of bodies connected like this, or connecting bodies with greatly varying mass?
Since Erin went to the trouble of making a new class instead of adding an option to the distance joint, I'd have to assume yes, we're both missing something.

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