With the release of the 2.0.1 update of Box2D a couple of things have changed. Here are a couple of changes I have found. If you know of more post a comment.
Previously when creating bodies you had to specify if the body was static or dynamic, this is no longer the case. The engine itself will determine the body type based on its density setting. If you set the density of the shapes to 0 the body will be static and any non-zero value will make it dynamic. Example:
//Create a static body var staticPoly:b2PolygonDef = new b2PolygonDef(); staticPoly.SetAsOrientedBox(10, 10, new b2Vec2(0, 0), 0); staticPoly.friction = .5; //Setting the density to 0 will make the body that contains this poly static staticPoly.density = 0; staticPoly.restitution=0; var staticBodyDef:b2BodyDef = new b2BodyDef(); staticBodyDef.position.Set(0,0); var staticBody = m_world.CreateBody(staticBodyDef); //New shape instantiation does not need to define static or dynamic staticBody.CreateShape(staticPoly) staticBody.SetMassFromShapes(); //Create a dynamic body var dynamicPoly:b2PolygonDef = new b2PolygonDef(); dynamicPoly.SetAsOrientedBox(10, 10, new b2Vec2(0, 0), 0); dynamicPoly.friction = .5; //Setting the density to any value greater then 0 will make the body that contains this poly dynamic dynamicPoly.density = 1; dynamicPoly.restitution=0; var dynamicBodyDef:b2BodyDef = new b2BodyDef(); dynamicBodyDef.position.Set(0,0); var dynamicBody = m_world.CreateBody(dynamicBodyDef); //New shape instantiation does not need to define static or dynamic dynamicBody.CreateShape(dynamicPoly) dynamicBody.SetMassFromShapes();
A couple of minor changes have been made to the distance joint type. It now includes a dampening factor and a frequency. I can’t really seem to figure out what they do though. I am probably wrong but I don’t think they are working properly in flash yet.