suppose I create two box2d bodies with their shapes and definition, also set their position, now at any point of time I want to check if they overlap or collide, how can I do this, please help!
i create a body like this
b2BodyDef ballBodyDef;
b2Body *ballBody;
b2PolygonShape ballShape;
b2FixtureDef ballShapeDef;
ballBodyDef.type = b2_dynamicBody;
ballBodyDef.position.Set(ball->getPosition().x/PTM_RATIO,
ball->getPosition().y/PTM_RATIO);
ballBodyDef.userData = ball;
ballBody= _world->CreateBody(&ballBodyDef);
ballShape.SetAsBox(ball->getContentSize().width/PTM_RATIO/2,
ball->getContentSize().height/PTM_RATIO/2);
ballShapeDef.shape = &ballShape;
ballShapeDef.density = 10.0;
ballShapeDef.isSensor = true;
ballBody->CreateFixture(&ballShapeDef);