我正在尝试添加一条线作为 box2d 主体,厚度几乎为 0 或 1 像素。我尝试使用很多方法,如 setasedge、setasbox,但我无法得到它。
groundBox.SetAsEdge(b2Vec2([self x:256],[self y:0]), b2Vec2([self x:256],[self y:64]));
//groundBox.SetAsBox(0.01, 1.11, b2Vec2([self x:256],[self y:0]), 0.1);
groundBody->CreateFixture(&groundBox,0.1f);
并且对于 b2EdgeShape 显示它不存在。我包含在 box2d 参考 api 中。你能建议我画一条几乎为零粗细的线吗?