For benchmarking and optimizing parts of the engine, as well as allowing users to quickly see what is taking time, it would be very valuable to have diagnostics for physics.
This includes:
Profiles for durations of tasks
Broad phase
Narrow phase
Solver
Prepare
Warm start
Integrate velocities
Solve constraints
Integrate positions
Relax velocities
Apply restitution
Finalize
Store impulses
Send collision events
Spatial query updates
Counts for bodies/colliders/contacts/joints
These diagnostics could be optional and/or behind a feature flag, and enabled with a PhysicsDiagnosticsPlugin. I believe the idiomatic place to store them would be the DiagnosticsStore in bevy_diagnostic.
An optional debug UI could also be provided, similar to the one in Box2D's sample app.
For benchmarking and optimizing parts of the engine, as well as allowing users to quickly see what is taking time, it would be very valuable to have diagnostics for physics.
This includes:
These diagnostics could be optional and/or behind a feature flag, and enabled with a
PhysicsDiagnosticsPlugin
. I believe the idiomatic place to store them would be theDiagnosticsStore
inbevy_diagnostic
.An optional debug UI could also be provided, similar to the one in Box2D's sample app.