bevy_rapier icon indicating copy to clipboard operation
bevy_rapier copied to clipboard

Expose up to date contact impulses

Open rasmusgo opened this issue 2 years ago • 0 comments

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.

rasmusgo avatar Dec 22 '21 09:12 rasmusgo