I'm creating box2d game and trouble is as follows: Two fighters located on arena, top view. Fighters has weapons like sword in theis hands. I want to fighter bounces in hit direction when damaged by opponent, but fighters has same physical characteristics and applied impulse is not sufficient to bounce fighter considerably. How can I increase applied by box2d impulse in same (correct) direction? I overrided PostSolve method, but I don't understand how to affect to b2ContactImpulse passed to method. I think I just need increase value of that impulse, but I dont know how. Could someone explain me how to do it? Thanx!
Increasing impulse on collision in box2d
FlashMultiply impulse.normalImpulses[0] by the amount you want to increase. This is a Number, so yeah. I'm actually not sure if changing this (i.e. assigning impulse.normalImpulses[0] with a different number) will affect anything (since it's post solve). If changing that number doesn't work, you can try to apply the impulse manually (body.ApplyImpulse(worldDir:b2Vec2,worldPos:b2Vec2)).
Here is an page about using b2ContactImpulse: http://blog.allanbishop.com/box-2d-2-1a ... -strength/
Here is an page about using b2ContactImpulse: http://blog.allanbishop.com/box-2d-2-1a ... -strength/
Original thread: https://box2d.org/forum/viewtopic.php?t=8627