How does Box2D work out shape1 and shape2 in contact?

Hi,

I have a Contact Listener running, it returns the Contact Points from the stack which I iterate over. From these I check the two shapes returned (and their corresponding bodies) and then act upon those results.

I was just wondering how does Box2D work out which is shape1 and which is shape2? The results seem to be very consistent in my game at least. Shape2 is always the sensors on my actor, shape1 the world tiles. I just wondered how Box2D is deciding what order to put them in? (i.e. is shape1 always the largest of the two shapes or something?)

Cheers,

Rich
Heh, I just asked the exact same question Yesterday 🙂

viewtopic.php?f=8&t=3312

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