Calculating distance between bodies/polygons

Hi,

I have a problem with creating a game using box2d for just collision detection. The problem is that I have to check for example for collisions between penguin and the piranha.
I want to check collisions between them basing on their polygon shapes.
I think that I have to know BEFORE the collision will appear between the bodies (they cannot colide, if I detect the collision when the bodies would be collided it would be too late - I would have to move these objects to their previous states!).
So I want to calculate the distance between bodies, don't using Contact Listener. But I don't know how to do that. I read about function b2Distance from the box2d manual, but there are no information about how to create all needed things for this function! I have to give few parameters to this function, which are hard to create.
I think that the CCRect wouldn't be enough to detect collisions between player (penguin) and enemies. Can You help me? I don't want to create real physics for all elements, just use collision detection from box2d.
You may be able to use the b2TimeOfImpact function to check when two shapes will collide without letting them actually collide. Check out the b2TimeOfImpact.h/.cpp source files. I haven't used it myself yet though so I can't help with any details, sorry!

Original thread: https://box2d.org/forum/viewtopic.php?t=7351