Just spent the last 2 days trying to track down this bug in my flash port, only to find I get the same results in the original c++ version. Doh! :P
It seems that if a body attached to a b2RevoluteJoint moves beyond a certain speed (which seems to be relative to it's size) the position correction will cause it to explode (or perhaps the position correction is a result of it exploding? But it doesn't explode with position correction off).
Try this to see what I mean:
Like I said, if you set the extents to say 1.0, it won't explode at all unless you give it a tug with the mouse.
Also it's more likely to explode if the time step is larger (if you put it on 10 Hertz, it will explode right from the start).
Thanks Erin, would be great to get this sorted out.
It seems that if a body attached to a b2RevoluteJoint moves beyond a certain speed (which seems to be relative to it's size) the position correction will cause it to explode (or perhaps the position correction is a result of it exploding? But it doesn't explode with position correction off).
Try this to see what I mean:
Code:
{
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;
m_world->CreateJoint(&jd);
}
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;
m_world->CreateJoint(&jd);
}
Like I said, if you set the extents to say 1.0, it won't explode at all unless you give it a tug with the mouse.
Also it's more likely to explode if the time step is larger (if you put it on 10 Hertz, it will explode right from the start).
Thanks Erin, would be great to get this sorted out.