playrho::ConstraintSolverConf Struct Reference

#include <ContactSolver.hpp>

Public Member Functions

ConstraintSolverConfUseResolutionRate (Real value) noexcept
 Uses the given resolution rate. More...
 
ConstraintSolverConfUseLinearSlop (Length value) noexcept
 Uses the given linear slop. More...
 
ConstraintSolverConfUseAngularSlop (Angle value) noexcept
 Uses the given angular slop. More...
 
ConstraintSolverConfUseMaxLinearCorrection (Length value) noexcept
 Uses the given max linear correction. More...
 
ConstraintSolverConfUseMaxAngularCorrection (Angle value) noexcept
 Uses the given max angular correction. More...
 

Public Attributes

Real resolutionRate = Real(0.2)
 
Length linearSlop = DefaultLinearSlop
 
Angle angularSlop = DefaultAngularSlop
 
Length maxLinearCorrection = DefaultLinearSlop * Real{20}
 
Angle maxAngularCorrection = DefaultAngularSlop * Real{4}
 

Detailed Description

Constraint solver configuration data.

Defines how a constraint solver should resolve a given constraint.

See also
SolvePositionConstraint.

Definition at line 69 of file ContactSolver.hpp.

Member Function Documentation

◆ UseResolutionRate()

ConstraintSolverConf & playrho::ConstraintSolverConf::UseResolutionRate ( Real  value)
inlinenoexcept

Uses the given resolution rate.

Definition at line 118 of file ContactSolver.hpp.

◆ UseLinearSlop()

ConstraintSolverConf & playrho::ConstraintSolverConf::UseLinearSlop ( Length  value)
inlinenoexcept

Uses the given linear slop.

Definition at line 124 of file ContactSolver.hpp.

◆ UseAngularSlop()

ConstraintSolverConf & playrho::ConstraintSolverConf::UseAngularSlop ( Angle  value)
inlinenoexcept

Uses the given angular slop.

Definition at line 130 of file ContactSolver.hpp.

◆ UseMaxLinearCorrection()

ConstraintSolverConf & playrho::ConstraintSolverConf::UseMaxLinearCorrection ( Length  value)
inlinenoexcept

Uses the given max linear correction.

Definition at line 136 of file ContactSolver.hpp.

◆ UseMaxAngularCorrection()

ConstraintSolverConf & playrho::ConstraintSolverConf::UseMaxAngularCorrection ( Angle  value)
inlinenoexcept

Uses the given max angular correction.

Definition at line 142 of file ContactSolver.hpp.

Member Data Documentation

◆ resolutionRate

Real playrho::ConstraintSolverConf::resolutionRate = Real(0.2)

Resolution rate.

Defines the percentage of the overlap that should get resolved in a single solver call. Value greater than zero and less than or equal to one. Ideally this would be 1 so that overlap is removed in one time step. However using values close to 1 often leads to overshoot.

Note
Recommended values are: 0.2 for solving regular constraints or 0.75 for solving TOI constraints.

Definition at line 94 of file ContactSolver.hpp.

◆ linearSlop

Length playrho::ConstraintSolverConf::linearSlop = DefaultLinearSlop

Linear slop.

Note
The negative of this amount is the maximum amount of separation to create.
Recommended value: DefaultLinearSlop.

Definition at line 99 of file ContactSolver.hpp.

◆ angularSlop

Angle playrho::ConstraintSolverConf::angularSlop = DefaultAngularSlop

Angular slop.

Note
Recommended value: DefaultAngularSlop.

Definition at line 103 of file ContactSolver.hpp.

◆ maxLinearCorrection

Length playrho::ConstraintSolverConf::maxLinearCorrection = DefaultLinearSlop * Real{20}

Maximum linear correction.

Maximum amount of overlap to resolve in a single solver call. Helps prevent overshoot.

Note
Recommended value: linearSlop * 40.

Definition at line 109 of file ContactSolver.hpp.

◆ maxAngularCorrection

Angle playrho::ConstraintSolverConf::maxAngularCorrection = DefaultAngularSlop * Real{4}

Maximum angular correction.

Maximum angular position correction used when solving constraints. Helps to prevent overshoot.

Note
Recommended value: angularSlop * 4.

Definition at line 115 of file ContactSolver.hpp.


The documentation for this struct was generated from the following file: