I'm using postSolve to get impulse then calculate damage base on that impulse. But there's some issue:
The damage isn't stable. When the same ball is hitting with same speed, the damage varies depending on where the player gets hit. The player has multiple bodies, connected with joints. And when the ball hits a body with less density, that body tend to move with the ball, reducing the impulse. (because part of the player is wood, part of him is metal, so density is different).
Sometimes I want to predict the damage when the ball is in the air before it actually hit the player, I can both know whether the ball will hit the player and its speed when the collision happen. However, with all these info I still couldn't predict the damage because I use postSolve to get impulse.
I know postSolve is called a lot and it doesn't seem necessary when calculating damage.In fact, I had to manually deduct the impact caused by the ball's weight. Otherwise, my player would be bleeding continuously when there's a still ball on his head.
Because of the above issues, now I'm doubting if I should consider switching to using
beginContact and calculate the impulse by myself rather than using
Opinions may vary among different people, I have a screenshot of my game below to help you give advice for my specific game:
And I do hope the physics look close to real.