bevy_rapier
bevy_rapier copied to clipboard
Expose up to date contact impulses
I want to play audio in response to collisions. There are already ways to respond to collisions but none of them contains up to date impulses because the logic happens between collision detection and collision response.
The details are in step_generic in physics_pipeline.rs. It runs detect_collisions towards the end of each substep after velocities and positions have been updated. This will erase the information about impulses for all contacts that are no longer touching. I think it would make sense to add a new event or a hook to publish the correct impulses before calling detect_collisions.