Collision problem

Hi,

I have a game with destructable terrain, and everything works fine %99.9 of the time but like the case I attached, my character suddenly jumps to middle of the floor below itself immediately after I recreate the terrain's fixtures after an explosion. Terrain itself has number of fixtures with a chain shapes in them (depending on the number of independent parts terrain is) and I'm recreating the fixtures and the chain shapes every time an explosion happens. Interestingly enough this specific case is fixed if I move the top ellipse shape (b2PolygonShape) of the character up, seperating it from the bottom circle shape. I think this is just random though so separating those shapes won't fix other similar cases.

Why is this happening? Any ideas?

Thank you.
Dumps of before and after the explosion to give more info.
More info: If I move the ant up and leave it it drops to the same incorrect location as if there is nothing under it? This definitely seems like a bug to me, anybody with an opinion?
Perhaps the AABBs are getting messed up. It looks like you're using the testbed, so it would be easy to check where they are by turning the AABB display on.

If this is the problem, one slightly hacky trick I have used that might help to reset the AABBs:
Code:
bool wasActive = body->IsActive();
body->SetActive( ! wasActive );
body->SetActive( wasActive );
No, this is not from a testbed but form an ios app. I just hid everything so that shapes will be easy to see.

I also tried using individual edge shapes without ghost vertices (Since I am using a circle below I don't even need them I believe, correct me if I'm wrong please). It seems to be solving this case as well, I don't know why though. It should have worked with chain as well.

The strange thing is the positioning of the character. It does not make any sense at all, it's upper shape is just vertically centered between those two edges...

I also have a question not related to this: I'm getting a b2ContactEdge (let's say edge) from a body via it's GetContactList function. if edge->other equals to a some other body let's say (otherbody) can I assume that edge->contact->GetFixtureA() will be the fixture on otherbody ? It always seems to be the case here. Is it pure luck or is it supposed to be like this?

Thank you.
I see. Well, you can turn on the display for the AABBs by including the e_aabbBit in the debug draw flags.

No, it could be GetFixtureA or GetFixtureB, there is no guarantee which one.
I did what you said and AABB's seems to be correct. Any idea why using edgeshapes without ghost edges solves this? Or moving the ellipse polygon shape of the character a bit above? I couldn't sense of the whole thing. Feels like a bug to me. Maybe my dumps I posted above will be helpful
Not sure... this may be related though viewtopic.php?f=4&t=8867

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