Bepu Physics: MaxStepPerFrame does not bound steps per frame, and -1 stops the simulation from advancing
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Start at the loop in sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/BepuSimulation.cs#L734 and check how its condition combines stepCount with MaxStepPerFrame. Verify the loop respects the configured limit and that -1 allows the simulation to advance.
Written by the indexing model from the issue text.
Description
Release Type: GitHub
Version: 5cefe91c1a13d91154a696352147340ff6fb77fe
Describe the bug
sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/BepuSimulation.cs#L734
for (int stepCount = 0; _remainingUpdateTime >= FixedTimeStep &&
(stepCount < MaxStepPerFrame || MaxStepPerFrame != -1);
stepCount++, _remainingUpdateTime -= FixedTimeStep)
Because MaxStepPerFrame does not change during the loop, the second operand
does not depend on stepCount, and the guard reduces to the value of
MaxStepPerFrame:
- Any value other than
-1(including the default3):MaxStepPerFrame != -1
is true, so the guard is true for everystepCount. The number of steps taken
in oneUpdatecall is not bounded byMaxStepPerFrameat all. -1:stepCount < -1is never true (stepCountstarts at 0) and
MaxStepPerFrame != -1is false, so the loop body never executes and the
simulation does not advance.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 76
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stride3d/stride
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stride3d/stride#3386 · 7 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
stride3d/stride#3384 · 1 comment ·
Maintainers usually reply within 1 day
-
area-Samples bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stride3d/stride#3066 · 6 comments ·
Maintainers usually reply within 1 day
-
area-Doc
Difficulty 1/5 Under an hour Newbie friendliness 78/100
stride3d/stride#2452 · 4 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
owasp-dep-scan/dosai#79 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pyrevitlabs/pyRevit#3730 ·
Maintainers usually reply within 1 day
-
bug component/other
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
umbraco/Umbraco.AI#511 ·
Maintainers usually reply within 1 day
-
sev:L
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Systemorph/MeshWeaver#6233 ·
Maintainers usually reply within 1 day
-
[Bug]:Openbug needs response
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Adyen/adyen-dotnet-api-library#1874 ·
Maintainers usually reply within 1 day