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.
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.