one meter is about 32 pixels.
without looking at the manual, my guess is that since SetAsBox()
is a box2d function, it takes parameters in meters. So if you have pixel values, you could just use this definition to easily convert to meters:
#define PTM_RATIO 32
including this in your files allows you to forget the ratio and just use this definition whenever you need to convert between pixels and meters. when you actually do the conversion, you can just divide or multiply by this ratio (32/1) depending on the context. Eg:
CGSize winSize = [[CCDirector sharedDirector] winSize];
b2Body *body = world->GetBodyList();
if(body->GetPosition().x*PTM_RATIO > winSize.width/2){
// do stuff....
}
This conditional wouldn't work if you compared meters (GetPosition) to pixels (winSize), so this is a great example of where this conversion is useful.
Or, in your case:
float pixel_width, pixel_height;
polygon_body.SetAsBox(pixel_width/PTM_RATIO, pixel_height/PTM_RATIO);