It depends on how you relate your physical world and graphics. It’s usually enough to split the position of the touch relative to the PTM_RATIO layer:
CGPoint touchLocation = [touch locationInView:[touch view]];
touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
CGPoint nodePosition = [self convertToNodeSpace: touchLocation];
b2Vec2 pos(nodePosition.x/PTM_RATIO, nodePosition.y/PTM_RATIO);
source
share