Add HitImpulse per object in .hitObjectList to collision sensor.


add hitImpulse to sensor per collider in hitObject list.
Allows for damage to be computed, or python to trigger based on magnitude of single collisions.

it is called “Pulse”

pulse mode only fires when the list changes?

you learn something new every day.

Thank you Monster.

I will remove request 1, and keep request 2.

The physics does not provide the impact of a collision (at least it is not provided by the BGE API).

It would be a nice feature.

Currently you need to, record the velocities at each frame and assume the overall impact from the records.

yes this works in most cases, however not if you have 2 equal and opposite impacts. (squished between two cars*)

also, if you want to use the direction of the vector of the collision to consider what will happen you can’t.

(like if I fall 10 feet and land on my feet I can be ok, but if I am flying forward and I clip my foot on something it will trip me)

the example with the feet is pretty simple as you can determine the orientation at the time of impact. Your example of counter forces that counter each does not matter at the physics model without deformations (as it does simply does not deform). It can be useful if you want to calculate possible deformation forces.

I do not know if Bullet provides such information. You might check the Bullet API if that is an option at all.

getting squished between two cars will kill a actor, or hurt him, impossible to tell at the moment.

at the moment you can’t really detect how hard they squished you unless you’re gathering data from all actors involved before the collision.