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 [ 32.71 KiB | Viewed 494 times ]
In Flash:
Attachment:
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