Step the timestep and solver tolerances on a well-tempered log ladder

The timestep, the solver tolerances, and impratio span several orders of
magnitude, where a linear +/- step is useless. Add ImGui_LogStepper, whose
buttons walk a "well-tempered" logarithmic ladder of round numbers that
closes each decade on a power of ten (see WellTemperedStep). It lays out
like ImGui's own InputScalar stepper -- field, then the - / + buttons, then
the label.

Apply it to the timestep, Tolerance, the LS/Noslip/CCD/Sleep tolerances,
and Imp Ratio. Strictly-positive quantities for which zero is meaningful
(the tolerances) take a zero_below floor: the ladder's bottom rung is 0, so
stepping down snaps to zero and stepping up off zero returns to the floor.
The timestep and impratio, which never want zero, leave it unset.

PiperOrigin-RevId: 965888812
Change-Id: I823e60913ecb2be2cade96baa5bf7de9e2334d5a
This commit is contained in:
Yuval Tassa
2026-08-17 04:30:04 -07:00
committed by Copybara-Service
parent ba3f8cf180
commit 90ac80707d
6 changed files with 143 additions and 13 deletions
+3 -3
View File
@@ -239,9 +239,9 @@ class Simulate {
float measured_slowdown = 1.0;
// logarithmically spaced real-time slow-down coefficients (percent)
static constexpr float percentRealTime[] = {
100, 80, 66, 50, 40, 33, 25, 20, 16, 13,
10, 8, 6.6, 5.0, 4, 3.3, 2.5, 2, 1.6, 1.3,
1, .8, .66, .5, .4, .33, .25, .2, .16, .13,
100, 80, 63, 50, 40, 32, 25, 20, 16, 13,
10, 8, 6.3, 5.0, 4, 3.2, 2.5, 2, 1.6, 1.3,
1, .8, .63, .5, .4, .32, .25, .2, .16, .13,
.1
};