Prismatic & Revolute Joint Instability

Prismatic & revolute joints seem to be a lot more "sloppy" in the latest revision. Bodies connected by a prismatic joint can move off-axis. Bodies connected by a revolute joint used to almost never separate, now it's very easy to get the anchor points "out of sync". I'm curious what changes caused this and if it something that's planning on being fixed, or if it's a change we'll just have to learn to deal with.

Example: In the Alchemy port TestBed it's easy to tear a (revolute joint based) rag doll apart by dragging it through the center static box. I'm currently trying to get the C++ test bed compiled (os x) to see if this is also the case there (it should - the Alchemy port is just the C++ code).
I have only seen joint problems with continuous simulation and bullets. Are you seeing something else?

Be careful about what you select to be a bullet; it should have behavior similar to a bullet.
Thanks for the reply. No, not using Bullets. I've put together a C++ test bed that (sort of) demonstrates this. It's a lot worse in the Flash version. I've attached screenshots of both (the C++ guy is also stuck in an edge shape). Basically trying to drag the rag doll through the box causes his limbs to pop off. I never saw this behavior before. I can improve on the test bed if it would help.

In C++:
Attachment:
Screen shot 2010-07-14 at 6.09.47 PM.png
Screen shot 2010-07-14 at 6.09.47 PM.png [ 32.71 KiB | Viewed 494 times ]


In Flash:
Attachment:
Screen shot 2010-07-14 at 6.12.27 PM.png
Screen shot 2010-07-14 at 6.12.27 PM.png [ 50.98 KiB | Viewed 494 times ]


The test bed code:

Code:
#ifndef RAGDOLL_H
#define RAGDOLL_H

class Ragdoll : public Test
{
public:
   enum
   {
      e_count = 20,
   };

   Ragdoll()
   {
      {
         b2BodyDef bd;
         b2Body* ground = m_world->CreateBody(&bd);

         b2PolygonShape shape;
         shape.SetAsEdge(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f));
         ground->CreateFixture(&shape, 0.0f);
      }

      {
      
         b2RevoluteJointDef rd;
         b2BodyDef bd;
         b2PolygonShape ps;
         b2Body* b;
         b2Body* b2;
         b2Body* b3;
         
         // Center Box
         
         bd.position.Set(0, 10.0f);
         b2 = m_world->CreateBody(&bd);
         ps.SetAsBox(3.0f, 3.0f);
         b2->CreateFixture(&ps, 0.0f);
         
         // Ragdoll
         
         bd.type = b2_dynamicBody;
         
         // Torso
         
         bd.position.Set(0, 20.0f);
         b2 = m_world->CreateBody(&bd);
         ps.SetAsBox(1.0f, 2.0f);
         b2->CreateFixture(&ps, 1.0f);
         
         // Limbs
         
         ps.SetAsBox(2.0f, 0.5f);         
         
         // Left Arm
         
         bd.position.Set(-2.5f, 22.0f);
         b = m_world->CreateBody(&bd);
         b->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b2, b2Vec2(-0.5f, 22.0f));
         m_world->CreateJoint(&rd);
         
         bd.position.Set(-6.5f, 22.0f);
         b3 = m_world->CreateBody(&bd);
         b3->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b3, b2Vec2(-4.5f, 22.0f));
         m_world->CreateJoint(&rd);
         
         // Right Arm
         bd.position.Set(2.5f, 22.0f);
         b = m_world->CreateBody(&bd);
         b->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b2, b2Vec2(0.5f, 22.0f));
         m_world->CreateJoint(&rd);   
         
         bd.position.Set(6.5f, 22.0f);
         b3 = m_world->CreateBody(&bd);
         b3->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b3, b2Vec2(4.5f, 22.0f));
         m_world->CreateJoint(&rd);   
         
         // Left Leg
         bd.position.Set(-2.5f, 18.0f);
         b = m_world->CreateBody(&bd);
         b->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b2, b2Vec2(-0.5f, 18.0f));
         m_world->CreateJoint(&rd);
         
         bd.position.Set(-6.5f, 18.0f);
         b3 = m_world->CreateBody(&bd);
         b3->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b3, b2Vec2(-4.5f, 18.0f));
         m_world->CreateJoint(&rd);
         
         // Right Leg
         bd.position.Set(2.5f, 18.0f);
         b = m_world->CreateBody(&bd);
         b->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b2, b2Vec2(0.5f, 18.0f));
         m_world->CreateJoint(&rd);
         
         bd.position.Set(6.5f, 18.0f);
         b3 = m_world->CreateBody(&bd);
         b3->CreateFixture(&ps, 1.0f);
         
         rd.Initialize(b, b3, b2Vec2(4.5f, 18.0f));
         m_world->CreateJoint(&rd);
      }
   }

   static Test* Create()
   {
      return new Ragdoll;
   }
};

#endif
Thanks for the example.

I ran it on the latest C++ version from SVN and it seems to work fine. Did you try running with the latest code?

Also, try disabling continuous completely to see if that solves the joint separation.

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