bevy_rapier icon indicating copy to clipboard operation
bevy_rapier copied to clipboard

Running the `boxes2` example twice gives two different results

Open aleksa2808 opened this issue 2 years ago • 4 comments
trafficstars

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

aleksa2808 avatar Dec 31 '22 01:12 aleksa2808

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

sebcrozet avatar Jan 24 '23 14:01 sebcrozet

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

rparrett avatar Jan 24 '23 14:01 rparrett

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 avatar Jan 24 '23 14:01 aleksa2808

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.

aleksa2808 avatar Jan 25 '23 11:01 aleksa2808