feat: rework solver parameters to make it easy to recover the old behaviors #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#579 introduced a new non-linear velocity-based constraints solver. This PR reworks the way solver iterations are specified so that some combination of them lets us recover the old solver’s behavior. This is mostly for comparison purpose or for case where the small performance hit of the new solver isn’t acceptable to the user.
IntegrationParameters::num_friction_iteration_per_solver_iteration
is replaced byIntegrationParameters::num_additional_friction_iteration
. This specifies how many extra friction iteration we want to run during the final solver iteration.IntegrationParameters::num_internal_pgs_iterations
indicates how many PGS iteration needs to be run within each solver iteration. Setting this value to4
andIntegrationParameters::num_solver_iterations
to 1 is equivalent to Rapier’s old solver.For convenience, the following methods were added:
IntegrationParameters::switch_to_standard_pgs_solver
to switch to the previous solver.IntegrationParameters::switch_to_small_steps_pgs_solver
to switch by to the new solver.The new solver is remains the default.