我正在尝试构建一个塔砖游戏(有从天上掉下来的形状,他们应该做一个塔)但是当我放下形状时,物理学不起作用,如果它们在角落上彼此重叠,它们就不会掉下来.. ..我该如何解决?
这是形状:
var fixDef = new b2FixtureDef;//shape 1
fixDef.shape = new b2PolygonShape;
fixDef.density = 0;
fixDef.friction = 0.5;
fixDef.restitution = 0.5;
fixDef.shape.SetAsArray([
new b2Vec2(-1, 0),
new b2Vec2(0, -1),
new b2Vec2(1, 0)],3
);
bodyDef.type = b2Body.b2_dynamicBody;
bodyDef.position.Set(24.5/30, 60/30);
bodyDef.userData = new Traingle();
addChild(bodyDef.userData);
world.CreateBody(bodyDef).CreateFixture(fixDef);
这就是世界: