Hello,
I've ran into a little hurdle and hope someone can help. What I'm trying to do is take a collision and "blow it up" by applying impulses to both bodies based off of the collision normal (one body gets the normal vector multiplied by some large positive value, the other body gets the same impulse but negative). This works perfect 90% of the time. For the other 10%, the normal vector is inverted, so the impulses actually smoosh the bodies together rather than blowing them up.
I'm using this procedure to make a user controlled body jump. It's works nice because the body can jump off of any body it's touching, and jump in the correct direction (not always straight up). I noticed this strange behavior when the body wouldn't jump off of certain objects (it would actually stick to them if I held jump down - the wrong-direction-impulse was being applied with each iteration).
I investigated all of the contact related classes but couldn't find anything to explain this... I was hoping to find some variable that was always 1 or -1 that I could multiply the normal by... it's not that simple I guess.
Thanks!
I've ran into a little hurdle and hope someone can help. What I'm trying to do is take a collision and "blow it up" by applying impulses to both bodies based off of the collision normal (one body gets the normal vector multiplied by some large positive value, the other body gets the same impulse but negative). This works perfect 90% of the time. For the other 10%, the normal vector is inverted, so the impulses actually smoosh the bodies together rather than blowing them up.
I'm using this procedure to make a user controlled body jump. It's works nice because the body can jump off of any body it's touching, and jump in the correct direction (not always straight up). I noticed this strange behavior when the body wouldn't jump off of certain objects (it would actually stick to them if I held jump down - the wrong-direction-impulse was being applied with each iteration).
I investigated all of the contact related classes but couldn't find anything to explain this... I was hoping to find some variable that was always 1 or -1 that I could multiply the normal by... it's not that simple I guess.
Thanks!