PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::ConstraintSolverConf Struct Reference

Constraint solver configuration data. More...

#include <ConstraintSolverConf.hpp>

Collaboration diagram for playrho::ConstraintSolverConf:
[legend]

Public Member Functions

constexpr ConstraintSolverConfUseResolutionRate (Real value) noexcept
 Uses the given resolution rate.
 
constexpr ConstraintSolverConfUseLinearSlop (Length value) noexcept
 Uses the given linear slop.
 
constexpr ConstraintSolverConfUseAngularSlop (Angle value) noexcept
 Uses the given angular slop.
 
constexpr ConstraintSolverConfUseMaxLinearCorrection (Length value) noexcept
 Uses the given max linear correction.
 
constexpr ConstraintSolverConfUseMaxAngularCorrection (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...
 

Detailed Description

Constraint solver configuration data.

Defines how a constraint solver should resolve a given constraint.

See also
SolvePositionConstraint.
Examples
PulleyJoint.cpp, and TargetJoint.cpp.

Member Data Documentation

◆ angularSlop

Angle playrho::ConstraintSolverConf::angularSlop = DefaultAngularSlop

Angular slop.

Note
Recommended value: DefaultAngularSlop.

Referenced by playrho::d2::InitVelocity(), playrho::d2::SolvePosition(), and UseAngularSlop().

◆ 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.

Referenced by playrho::d2::InitVelocity(), playrho::d2::SolvePosition(), and UseLinearSlop().

◆ 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.

Referenced by playrho::d2::SolvePosition(), and UseMaxAngularCorrection().

◆ 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.

Referenced by playrho::d2::SolvePosition(), and UseMaxLinearCorrection().

◆ 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.

Referenced by UseResolutionRate().


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