Box2D Version 1.4.2 Released

1.4.2
- Resolved revolute joint instability.

Please see TODO.txt for future plans.

Please see Readme.txt for instructions.

http://sourceforge.net/projects/box2d
Awesome work Erin, it works brilliantly, and I love the new demo =D.
Thanks a lot for spending your time on this.

Don't forget to make this thread an announcement too, almost didn't see it down the bottom there. (:
No problem. I'm actually really glad you found the problem. This should save other people a lot of grief.

Yes, I always forget to click the announcement option.
I've been behind on the release, but I see major speed increases compared to the Sept. versions. Great work!
Hey Erin,
I'm really sorry to bother you again, but I think the changes made in 1.4.2 create a problem with limits in the revolute joint.
Joints seem to reach their limit, then slow down before turning around, as if it were a spring. And in some cases, the anchor point will detach.

Try this to see what I mean.

Code: Select all

      {
         b2BoxDef sd;
         sd.type = e_boxShape;
         sd.extents.Set(0.25f, 0.25f);
         sd.density = 1.0f;

         b2BodyDef bd;
         bd.AddShape(&sd);

         b2RevoluteJointDef jd;

         bd.position.Set(15.0f, 25.0f);
         b2Body* body = m_world->CreateBody(&bd);

         jd.anchorPoint.Set(0.0f, 25.0f);
         jd.body1 = m_world->m_groundBody;
         jd.body2 = body;
         jd.enableLimit = true;
         jd.lowerAngle = -30  / (180.0f/b2_pi);
         jd.upperAngle = 30  / (180.0f/b2_pi);
         m_world->CreateJoint(&jd);
      }

Don't worry about it too much, just if you have some spare time to take a look at it, that would be great.

Thanks,
-Matt.
This is another known limitation. You have a highly unbalanced torque. You can fix this by making the shape larger. Ideally the shape would cover the anchor point (like a long box).

What is the scenario you are trying to model?

That said, this problem has bugged me for awhile, so I'll probably look at it again at some point.

BTW, I tried this with 1.4.1 and it went completely unstable, so things are getting better!
Sorry Erin, that was my bad.
I had disabled warm starting on the revolute joint when I was trying to find the problem with the exploding and I'd forgotten to enable it again.
So even joints between close objects were having trouble stopping at their limits.
I should have tested it more thoroughly before posting, I only tried the example I posted, which I can understand isn't really a correct use of the joint.

So everything is great now, sorry about that. 😳

Thanks again for the update.
-Matt.

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