Ios4 _世界->;车身(车身B);在iphone的cocos2d中不会破坏身体
代码如下:Ios4 _世界->;车身(车身B);在iphone的cocos2d中不会破坏身体,ios4,cocos2d-iphone,fixtures,Ios4,Cocos2d Iphone,Fixtures,代码如下: for(NSValue *fixtureValue in fixtures) { b2Fixture *fixture; fixture = (b2Fixture*)[fixtureValue pointerValue]; if(contact.fixtureA==fixture && contact.fixtureB == carFixture) { NSLog(@"Car hit outersquare!");
for(NSValue *fixtureValue in fixtures)
{
b2Fixture *fixture;
fixture = (b2Fixture*)[fixtureValue pointerValue];
if(contact.fixtureA==fixture && contact.fixtureB == carFixture)
{
NSLog(@"Car hit outersquare!");
[redcar stopAction:moveAction];
_world->DestroyBody(bodyB); // does not destroy body
[self createCarBody];
speed = 0;
break;
}
}
please help...
“bodyB”来自哪里?你是说
_world->DestroyBody(carFixture->GetBody());
或者类似的
无论如何,我建议您使用CCBox2D将Box2D与用于iphone的cocos2d结合使用