I am a beginer of BOX2D, and I found I don t know how to CREATE a user-difined body from specific sprite. All box2d body shape are Polygon related shapes :(
下面,由于您的事先帮助,我仅靠大麻使用一种特定的形式。
PhysicsSprite *rightSprite = [PhysicsSprite spriteWithFile:@"mySpecificShape.png"];
[self addChild:rightSprite];
b2BodyDef bodyDef;
bodyDef.type = b2_staticBody;
bodyDef.position = b2Vec2(400/PTM_RATIO, 512/PTM_RATIO);
b2Body * bodyA = world->CreateBody(&bodyDef);
bodyA->SetUserData(rightSprite);
[rightSprite setPhysicsBody:bodyA];