Cocos2d iphone 使用box2D删除实体

Cocos2d iphone 使用box2D删除实体,cocos2d-iphone,box2d,box2d-iphone,Cocos2d Iphone,Box2d,Box2d Iphone,我需要从我的世界边界中删除一个特定的向量,例如只删除左向量。 box2d+cocos2d iphone 这是我设置边界的方式: screenBorderShape.Set(lowerLeftCorner, lowerRightCorner); screenBorderBody->CreateFixture(&screenBorderShape, 0); screenBorderShape.Set(lowerRightCorner, upperRightCorner); screen

我需要从我的世界边界中删除一个特定的向量,例如只删除左向量。 box2d+cocos2d iphone

这是我设置边界的方式:

screenBorderShape.Set(lowerLeftCorner, lowerRightCorner);
screenBorderBody->CreateFixture(&screenBorderShape, 0);
screenBorderShape.Set(lowerRightCorner, upperRightCorner);
screenBorderBody->CreateFixture(&screenBorderShape, 0);
screenBorderShape.Set(upperRightCorner, upperLeftCorner);
screenBorderBody->CreateFixture(&screenBorderShape, 0);
screenBorderShape.Set(upperLeftCorner, lowerLeftCorner);
screenBorderBody->CreateFixture(&screenBorderShape, 0);
我怎样才能只拆下左边的那个

我知道这一点:

screenBorderBody->DestroyFixture(b2Fixture *fixture)
但是我以后需要这样做,所以我可以在没有将这个特定的保存为全局指针的情况下访问具有主体指针的夹具吗


谢谢。

screenBorderShape.SetlowerRightCorner,upperRightCorner; screenBorderBody->CreateFixture和screenBorderShape,0

将此设备命名为“左设备”或“左墙…”

在此之后,您可以使用screenBorderBody->DestroyFixture

方法是

接地盒。Setb2Vec2X1/PTM_比率、Y1/PTM_比率、b2Vec2X2/PTM_比率、Y1/PTM_比率; bottomFixture=groundBody->CreateFixture&groundBoxDef

然后取下箱子里剩下的底部固定装置

如果您只是想取消碰撞,可以通过这样设置类别或掩码位来完成