raisim::contact::BisectionContactSolver
class · #include <raisim/contact/BisectionContactSolver.hpp>
RaiSim's iterative contact solver: a Gauss-Seidel-style sweep over the constraint rows in which each frictional contact is solved with a bisection method. It is owned by the World (World::getContactSolver()); users typically only tune its SolverConfiguration.
Nested classes
structSolverConfiguration — Tuning parameters of the solver.
Constructors & destructor
BisectionContactSolver
explicit BisectionContactSolver() = defaultPublic member functions
solve
void solve(ContactProblems &contact)Solve the constraint rows in place: writes Single3DContactProblem::imp_i and applies the impulses to the objects' velocities.
Parameters
| Parameter | Description |
|---|---|
contact (in, out) | Constraint rows built by the World. |
solveWithTendons
void solveWithTendons(ContactProblems &contact, TendonSystem &tendons)Same as solve() but also solves the rows of a tendon system together with the contacts.
Parameters
| Parameter | Description |
|---|---|
contact (in, out) | Constraint rows built by the World. |
tendons (in, out) | Tendon system whose rows are solved jointly. |
updateConfig
void updateConfig(SolverConfiguration config)Replace the solver configuration.
Parameters
| Parameter | Description |
|---|---|
config (in) | New configuration. |
setTimestep
void setTimestep(double dt)Set the simulation time step used by the solver.
Parameters
| Parameter | Description |
|---|---|
dt (in) | Time step in seconds. |
setOrder
void setOrder(bool order)Set the sweep direction of the next solve. Each solve flips the direction afterwards; scenes with pin constraints always sweep forward.
Parameters
| Parameter | Description |
|---|---|
order (in) | true: first-to-last row, false: last-to-first. |
getOrder
bool getOrder() constReturns The sweep direction of the next solve (true: forward). See setOrder().
getPinCorrectionRate
double getPinCorrectionRate() constReturns The rate (1/s) at which pin position errors are corrected: clamp(0.2 * erp, 0, 0.3) / dt.
getLoopCounter
int getLoopCounter() constReturns The number of iterations performed by the last solve.
getWarmStartComparisons
uint64_t getWarmStartComparisons() constReturns The number of cached contacts the last warm start compared with current contacts.
getConfig
SolverConfiguration &getConfig()Returns Mutable reference to the solver configuration.
const SolverConfiguration &getConfig() constReturns The solver configuration.