Ok. That is indeed the answer, good job. So I have to apologize that my statement before saying "If EndContact is not called after the first frame where the two fixtures separate it would be a big bug" was incorrect
🙁 sorry about that.
I had been using the testbed to check this stuff but I had not noticed that even when you pause the testbed, it is still calling Step() all the time, but with a time step length of zero. If Erin is reading this, perhaps the testbed should skip world steps altogether when paused so that the 'Single Step' button gives a better reproduction of what people will see in their own programs - one click, one Step().
Another thing that confused me is this statement from your second post in this thread:
Loren wrote:
Step2: The body is near to the ground, and not touching it. A new b2Contact is returned by BeginContact callback. IsTouching=true. TOI flag=true.
As you say, "Box2d update touching flag in the collision step before move the body" so this cannot be true... could you check that?
So it seems one way you could tackle this problem is to call Step again with a time step length of zero, to get the contacts status to update without actually moving any bodies. For a large scene this may be a little inefficient, but you can't get the information without calculating it
😉