bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Misleading documentation for PhysicsStepSet::First and PhysicsStepSet::Last

Open idanarye opened this issue 7 months ago • 0 comments
trafficstars

The documentation for PhysicsStepSet::First says:

Runs at the start of the PhysicsSchedule. Empty by default.

Last's documentation is similar - in contrast with all the other sets which are documented as "Responsible for" something.

From this, it seems like First and Last are left empty so that users can put their own systems in them (assuming they want said systems to be in PhysicsSchedule). But this is not the case - the interpolation system runs in PhysicsStepSet::First:

https://github.com/Jondolf/avian/blob/eba14d257380006cd4d55177a3ea229cecde33ff/src/interpolation.rs#L290-L294

From what I've seen, in 0.2.1 this is the only one - but in the main branch there are several systems under diagnostics that use PhysicsStepSet::First and PhysicsStepSet::Last.

Since all these things are optional, this can be an alternative interpretation for "Empty by default". Still - it's confusing. Maybe the documentation can clarify that Avian itself may add systems to these steps if some plugins are enabled?

idanarye avatar Mar 24 '25 18:03 idanarye