Its about b2EdgeChainDef

Some way to create body in older version of box2das3 is:


Code: Select all

var bodyDef: b2BodyDef = new b2BodyDef();
var chainDef: b2EdgeChainDef = new b2EdgeChainDef();
chainDef.friction = 0.5;
chainDef.restitution = 0.0;
chainDef.vertices.push(new b2Vec2(x1, y1)); //Must pass b2Vec2 for line coordinates
chainDef.vertices.push(new b2Vec2(x2, y2));
chainDef.vertexCount = chainDef.vertices.length; //# of points = however many in definition
world.GetGroundBody().CreateShape(chainDef); //Create the edgeShape


(this is from tutorial about svg and box2d)

Please, help me to apllying this to 2.1a.
THere isn't an easy way in the release, you must manually create each edge using b2Polygon.AsEdge. In the SVN, there's b2PolyLine that serverse the same point as b2EdgeChain.

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