dimforge / bevy_rapier

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

Running the `boxes2` example twice gives two different results #305

Open aleksa2808 opened 1 year ago

aleksa2808 commented 1 year ago

As stated in the title, running the boxes2 example back-to-back gives two visibly different results. Running the 2D CCD example from the rapier repo gives the same result every time. Is it possible there is a bug in the bevy plugin layer that's causing the difference?

First run: image

Second run: image

sebcrozet commented 1 year ago

That’s likely related to https://github.com/dimforge/bevy_rapier/pull/233

rparrett commented 1 year ago

FWIW, I can reproduce the behavior on an M1 mac.

aleksa2808 commented 1 year ago

That’s likely related to #233

Perhaps, although in the current state of that pull request I'm still getting differing results with the boxes2 example.

aleksa2808 commented 1 year ago

As stated in the Bevy discord's #physics channel, when I add the RapierConfiguration resource with TimestepMode::Fixed (tried with dt = 1.0 / 60.0 and substeps = 1 values) each run is now the same.

The question now is: was I wrong in assuming that two boxes2 example invocations with the default plugin configuration would provide the same result? If so, then there is no bug present and I can close this issue.