jcornaz / heron

[DISCONTINUED] An ergonomic physics API for bevy games
MIT License
292 stars 44 forks source link

feat!: Provide stage to allow running systems before/after each physics step #55

Closed jcornaz closed 3 years ago

jcornaz commented 3 years ago

The physics steps run at a fixed rate (60 updates per second by default). They are therefore not in sync with the frame update (that runs as many times per second as possible).

But a user may want (and sometime have to) run system synchronously with the physics step. Generally either before (when modifying position/velocities) or after the physiscs step (when reading the output).

This PR exposes the following stages:

It also add the add_physiscs_system extension function on AppBuilder: to make simpler to add systems that should be synchronized with the physics steps.

This is a breaking change: Updating the transforms/velocities or any other physics component of rigid bodies must now be done in the physics update stage. Make sure to add this systems using the new add_physics_system extension function on AppBuilder