Some way to create body in older version of box2das3 is:
(this is from tutorial about svg and box2d)
Please, help me to apllying this to 2.1a.
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.