Hi all! Here a new box2d's noob ^^
I have a problem with contact results.
I have a doll in my game (fixedrotation = true) and I need to know which face is in contact in the current frame (so if below edge is in contact with ground, he can jump). To do this, I use BeginContact and EndContact to add a contact list to my doll. Jéj, so with contact's normals I can know if he is standing over his foots and let him jump!
My problem is this: I apply Impulse to the doll if he has a contact below, he will jump in the next world->step. Then he will be separated from the ground (flying), But!, EndContact doesn't call the callback function in the same frame where he is flying for the very first time. So I have one frame where the doll is flying (he is not touching the ground), but the contact is still alive (and IsTouching() returning 'true'!!) I tried everything, to do it with pre and post-solve, to do it by myself in the world update (checking all contacts, looking for the body and checking if it touch), playing with TOI values... and i get always the same problem. I get contact before the doll touch ground (if he is falling) and in the next frame after the jump (where IsTouching() should return 'false').
Some idea of what im doing wrong? Should I use another method?
Thanks a lot!!!
Regards.
I have a problem with contact results.
I have a doll in my game (fixedrotation = true) and I need to know which face is in contact in the current frame (so if below edge is in contact with ground, he can jump). To do this, I use BeginContact and EndContact to add a contact list to my doll. Jéj, so with contact's normals I can know if he is standing over his foots and let him jump!
My problem is this: I apply Impulse to the doll if he has a contact below, he will jump in the next world->step. Then he will be separated from the ground (flying), But!, EndContact doesn't call the callback function in the same frame where he is flying for the very first time. So I have one frame where the doll is flying (he is not touching the ground), but the contact is still alive (and IsTouching() returning 'true'!!) I tried everything, to do it with pre and post-solve, to do it by myself in the world update (checking all contacts, looking for the body and checking if it touch), playing with TOI values... and i get always the same problem. I get contact before the doll touch ground (if he is falling) and in the next frame after the jump (where IsTouching() should return 'false').
Some idea of what im doing wrong? Should I use another method?
Thanks a lot!!!
Regards.

