I implemented collision detection using Box2D and found out that I have kinds messed up things. Though I wanted a Circle shape as the colliding body, it collides as if it is a square. I don;t know why.
First I read ,
and the code provided was working with no problem.
But, after reading the description in the b2ContactListener class file I was not happy about implementing it that way. The class file comments said
/// Implement this class to get contact information. You can use these results for
/// things like sounds and game logic. You can also get contact results by
/// traversing the contact lists after the time step. However, you might miss
/// some contacts because continuous physics leads to sub-stepping.
/// Additionally you may receive multiple callbacks for the same contact in a
/// single time step.
/// You should strive to make your callbacks efficient because there may be
/// many callbacks per time step.
/// @warning You cannot create/destroy Box2D entities inside these callbacks.
Therefore, I tend to use b2Body->GetContactList() in the update method as you can find it in the example below.
There I find this trouble of Circle being inferred as Square. (I really don't know what an b2ContactEdge is)
I can implement a more sophisticated listener class, but I'm afraid that it may kill my 3G's processor. :)
Did any of you encounter this scenario? What could be the solution?
ps: I don't know much about this copy right things.. The example files had some copy right information. Hope, Ray won;t sue me for using his file here and modifying it.