How to create a fixed joint - Solved with code

Committed.
I took a look at the fixed point, but its got too much wrong with it. It's not my area of expertise.
Ok thanks!
Hello Boris,

After your remark of putting the whole joint in a single equation, I spent some more time with the formulas and derived the correct equation.

The result is that the joint has become more expensive to calculate, but it is much more stable so requires less iterations.

I've updated the document and code at http://jrouwe.nl/fixedjoint/.

Can you integrate it once more? You only need to update b2FixedJoint.cpp/h

Jorrit.
Has this been updated? I'm using whatever's in trunk, and it's got some weird behavior. When I connect together some squares, the resulting structure reacts very strangely when... well pretty much most of the time... I'll try taking that updated code and see if its any better.

Edit: Behavior still strange but in a decidedly different way. 😕 If I have two boxes like this

Code:
___
|__|
                   __
                  |__|


and fix them together with the joint, just placing them on anything causes really weird impulses making them act very unnaturally, i could describe it as being seizure-like. Eventually it warps through my static edge chain groundbody and falls to oblivion.

I do appreciate your work on this though, jrouwe -- maybe there's something I'm doing wrong? Perhaps some of the changes in the trunk build are in conflict...
Hello,

As far as I know the code in the trunk is still the old version. The old version works, but is less stable and requires a higher loop count than the default (default = 10, needs 20-30).

You could take the code from my web site (b2FixedJoint.cpp/h) and adjust it for the trunk (trivial) and see if that works. Alternatively you can put your configuration in the demo app (replace the fixed constraint test that I put in there) and send me the sources so I can take a look at what is going wrong.

I'm using the joint for my own project and I don't have any issues with it so far.

Jorrit.
I'm not sure what you mean by higher loop count. Is that one of the arguments passed to b2World::Step()?

If that doesn't fix it i'll see if I can make a demo for it.
edit: I'm having some issues compiling testbed. stay tuned.

edit:

I checkout the SVN 221. Go to trunk directory. run make. Massive amount of linking errors (undefined reference to blah).

I can get the testbed in branches and core to compile, though. I guess as a last resort I can try to copy over the source files...
Yes, i mean the parameter that you pass to Step. It also might be called iteration count, I don't have the sources right now.
Yeah, I tried it with position and velocity iterations both at 50, still has some weeeeeeeird behavior.

Sorry I can't get the testbed working in trunk, but I'm fairly certain i have the right code included in my project.

Just try making two 2x2 boxes, with coordinates of, for example (0,20) and (4,0), then connect them with the fixed joint. Then fling it around, try to make it stand up on a flat surface (when I do this sometimes it will stay upright despite being clearly unbalanced and start gliding across the surface in a twitchy way), and place some stuff on top of it... It just does some really really weird things.
Which Compiler/OS are you on?

If the test bed is broken, I'll wait for a few days for it to sort out (I see that there was a major commit for 221) and then I'll see if I can reproduce your bug. In the mean time you could also try to put your setup in Box2D 2.0.1 with my patches applied to it so see if that works.

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