Jondolf / avian

ECS-driven 2D and 3D physics engine for the Bevy game engine.
https://crates.io/crates/avian3d
Apache License 2.0
1.55k stars 120 forks source link

Add physics diagnostics #564

Open Jondolf opened 3 days ago

Jondolf commented 3 days ago

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 the DiagnosticsStore in bevy_diagnostic.

An optional debug UI could also be provided, similar to the one in Box2D's sample app.

Box2D's diagnostics