dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.28k stars 259 forks source link

Improve system schedules #584

Closed Vrixyz closed 2 months ago

Vrixyz commented 2 months ago

This builds on top of https://github.com/dimforge/bevy_rapier/pull/576 to more easily visualize the impacts

This change doesn´t impact the execution, but orders systems more consistently, leading to simpler representation possible and less cognitive load.

Before

![multiple sets propagate](https://github.com/user-attachments/assets/1ea39ac1-f0b5-4e9c-8506-d9e144aceec7)

After

![Child system set](https://github.com/user-attachments/assets/3ffe49c6-7b65-4c66-8511-4fb984abbfca)

To be noted I'm not entirely sure keeping this RapierTransformPropagateSet is necessary, as a user might eventually want to order systems after systems, and there's no ambiguous beginning or end to this set.

Further improvements (out of scope)

Split RapierContext

There are systems running sequentially, but each write to different parts of RapierContext.

image

If we split RapierContext's:

We'd be able to parallelize some systems execution.