Constraint solver configuration data. More...
#include <ConstraintSolverConf.hpp>
Public Member Functions | |
| constexpr ConstraintSolverConf & | UseResolutionRate (Real value) noexcept |
| Uses the given resolution rate. | |
| constexpr ConstraintSolverConf & | UseLinearSlop (Length value) noexcept |
| Uses the given linear slop. | |
| constexpr ConstraintSolverConf & | UseAngularSlop (Angle value) noexcept |
| Uses the given angular slop. | |
| constexpr ConstraintSolverConf & | UseMaxLinearCorrection (Length value) noexcept |
| Uses the given max linear correction. | |
| constexpr ConstraintSolverConf & | UseMaxAngularCorrection (Angle value) noexcept |
| Uses the given max angular correction. | |
Public Attributes | |
| Real | resolutionRate = Real(0.2) |
| Resolution rate. More... | |
| Length | linearSlop = DefaultLinearSlop |
| Linear slop. More... | |
| Angle | angularSlop = DefaultAngularSlop |
| Angular slop. More... | |
| Length | maxLinearCorrection = DefaultLinearSlop * Real{20} |
| Maximum linear correction. More... | |
| Angle | maxAngularCorrection = DefaultAngularSlop * Real{4} |
| Maximum angular correction. More... | |
Constraint solver configuration data.
Defines how a constraint solver should resolve a given constraint.
| Angle playrho::ConstraintSolverConf::angularSlop = DefaultAngularSlop |
Angular slop.
DefaultAngularSlop. Referenced by playrho::d2::InitVelocity(), playrho::d2::SolvePosition(), and UseAngularSlop().
| Length playrho::ConstraintSolverConf::linearSlop = DefaultLinearSlop |
Linear slop.
DefaultLinearSlop. Referenced by playrho::d2::InitVelocity(), playrho::d2::SolvePosition(), and UseLinearSlop().
| Angle playrho::ConstraintSolverConf::maxAngularCorrection = DefaultAngularSlop * Real{4} |
Maximum angular correction.
Maximum angular position correction used when solving constraints. Helps to prevent overshoot.
angularSlop * 4. Referenced by playrho::d2::SolvePosition(), and UseMaxAngularCorrection().
| Length playrho::ConstraintSolverConf::maxLinearCorrection = DefaultLinearSlop * Real{20} |
Maximum linear correction.
Maximum amount of overlap to resolve in a single solver call. Helps prevent overshoot.
linearSlop * 40. Referenced by playrho::d2::SolvePosition(), and UseMaxLinearCorrection().
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.
0.2 for solving regular constraints or 0.75 for solving TOI constraints. Referenced by UseResolutionRate().