如何制作 b2EdgeShape?制作一个简单的 b2EdgeShape。在其之上构建的简单样板 b2EdgeShape。
我的代码:
var bodyDef = new Box2D.Dynamics.b2BodyDef;
bodyDef.type = Box2D.Dynamics.b2Body.b2_staticBody;
bodyDef.position.SetV(new Box2D.Common.Math.b2Vec2(250/30, 250/30));
var fixtureDef = new Box2D.Dynamics.b2FixtureDef;
fixtureDef.shape = new Box2D.Collision.Shapes.b2EdgeShape(
new Box2D.Common.Math.b2Vec2(2.5,0),
new Box2D.Common.Math.b2Vec2(2.5,2.5));
fixtureDef.density = 0;
fixtureDef.restitution = 0.0;
fixtureDef.friction = 0.0;
var body = world.CreateBody(bodyDef);
var fixture = body.CreateFixture(fixtureDef);