Step configuration. More...
#include <StepConf.hpp>
Public Types | |
using | iteration_type = TimestepIters |
Step iterations type. More... | |
Static Public Attributes | |
static constexpr auto | InvalidIteration = static_cast<iteration_type>(-1) |
Invalid iteration value. | |
Related Functions | |
(Note that these are not member functions.) | |
MovementConf | GetMovementConf (const StepConf &conf) noexcept |
Gets the movement configuration from the given value. More... | |
Length | GetMaxRegLinearCorrection (const StepConf &conf) noexcept |
Gets the maximum regular linear correction from the given value. | |
bool | IsMaxTranslationWithinTolerance (const StepConf &conf) noexcept |
Determines whether the maximum translation is within tolerance. | |
Step configuration.
Provides the primary means for configuring the per-step world physics simulation. All the values have defaults. These defaults are intended to most likely be the values desired.
deltaTime
) is correct for your use. Step iterations type.
A type for counting iterations per-step.
|
related |
Gets the movement configuration from the given value.
maxTranslation
and maxRotation
fields of the given value respectively are returned. Length playrho::StepConf::aabbExtension = DefaultAabbExtension |
AABB extension.
This is the extension that will be applied to Axis Aligned Bounding Box objects used in broad phase collision detection. This fattens AABBs in the dynamic tree. This allows proxies to move by a small amount without triggering a tree adjustment.
Referenced by playrho::d2::WorldImpl::SolveReg(), playrho::d2::WorldImpl::SolveToi(), playrho::d2::WorldImpl::Step(), and playrho::d2::WorldImpl::SynchronizeProxies().
AngularVelocity playrho::StepConf::angularSleepTolerance = DefaultAngularSleepTolerance |
Angular sleep tolerance.
Positive<Angle> playrho::StepConf::angularSlop = DefaultAngularSlop |
Angular slop.
Time playrho::StepConf::deltaTime = DefaultStepTime |
Delta time.
This is the time step in seconds.
Referenced by playrho::d2::InitVelocity(), playrho::d2::WorldImpl::SolveRegIslandViaGS(), playrho::d2::WorldImpl::SolveToi(), playrho::d2::WorldImpl::SolveToiViaGS(), playrho::d2::SolveVelocity(), playrho::d2::WorldImpl::Step(), and playrho::d2::Step().
bool playrho::StepConf::doToi = true |
Do time of impact (TOI) calculations.
Whether or not to perform any time of impact (TOI) calculations used for doing continuous collision detection. Without this, steps can potentially be computed faster but with increased chance of bodies passing unobstructed through other bodies (a process called "tunneling") even when they're not supposed to be able to go through them.
Referenced by playrho::d2::WorldImpl::Step().
bool playrho::StepConf::doWarmStart = true |
Do warm start.
Whether or not to perform warm starting (in the regular phase).
Referenced by playrho::d2::InitVelocity(), and playrho::d2::WorldImpl::SolveRegIslandViaGS().
Real playrho::StepConf::dtRatio = 1 |
Delta time ratio.
This is the delta-time multiplied by the inverse delta time from the previous world step. The value of 1 indicates that the time step has not varied.
Referenced by playrho::d2::InitVelocity(), and playrho::d2::Step().
LinearVelocity playrho::StepConf::linearSleepTolerance = DefaultLinearSleepTolerance |
Linear sleep tolerance.
Positive<Length> playrho::StepConf::linearSlop = DefaultLinearSlop |
Linear slop.
Linear slop for position resolution.
Referenced by playrho::d2::WorldImpl::Step().
Angle playrho::StepConf::maxAngularCorrection = DefaultMaxAngularCorrection |
Maximum angular correction.
Real playrho::StepConf::maxCirclesRatio = DefaultCirclesRatio |
Max. circles ratio.
When the ratio of the closest face's length to the vertex radius is more than this amount, then face-manifolds are forced, else circles-manifolds may be computed for new contact manifolds.
iteration_type playrho::StepConf::maxDistanceIters = DefaultMaxDistanceIters |
Max distance iterations.
Length playrho::StepConf::maxLinearCorrection = DefaultMaxLinearCorrection |
Maximum linear correction.
Angle playrho::StepConf::maxRotation = DefaultMaxRotation |
Maximum rotation.
The maximum amount a body can rotate in a single step. This represents an upper bound on the maximum angular speed of a body of max rotation / time.
iteration_type playrho::StepConf::maxSubSteps = DefaultMaxSubSteps |
Maximum sub steps.
This is the maximum number of sub-steps per contact in continuous physics simulation. In other words, this is the maximum number of times in a world step that a contact will have continuous collision resolution done for it.
Referenced by playrho::d2::WorldImpl::UpdateContactTOIs().
iteration_type playrho::StepConf::maxToiIters = DefaultMaxToiIters |
Max TOI iterations.
iteration_type playrho::StepConf::maxToiRootIters = DefaultMaxToiRootIters |
Max TOI root finder iterations.
Length playrho::StepConf::maxTranslation = DefaultMaxTranslation |
Maximum translation.
The maximum amount a body can translate in a single step. This represents an upper bound on the maximum linear velocity of a body of max-translation per time.
Time playrho::StepConf::minStillTimeToSleep = DefaultMinStillTimeToSleep |
Minimum still time to sleep.
The time that a body must be still before it will be put to sleep.
Referenced by playrho::d2::WorldImpl::SolveRegIslandViaGS().
Length playrho::StepConf::regMinSeparation = -DefaultLinearSlop * Real{3} |
Regular minimum separation.
This is the minimum amount of separation there must be between regular-phase interacting bodies for intra-step position resolution to be considered successful and end before all of the regular position iterations have been done.
Referenced by playrho::d2::WorldImpl::SolveRegIslandViaGS().
iteration_type playrho::StepConf::regPositionIterations = 3 |
Regular position iterations.
This is the maximum number of iterations of position resolution that will be done before leaving any remaining unsatisfied positions for the next step. In this context, positions are satisfied when the minimum separation is greater than or equal to the regular minimum separation amount.
Referenced by playrho::d2::WorldImpl::SolveRegIslandViaGS(), and playrho::d2::Step().
Regular resolution rate.
This scale factor controls how fast positional overlap is resolved. Ideally this would be 1 so that overlap is removed in one time step. However using values close to 1 often lead to overshoot.
iteration_type playrho::StepConf::regVelocityIterations = 8 |
Regular velocity iterations.
The number of iterations of velocity resolution that will be done in the step.
Referenced by playrho::d2::WorldImpl::SolveRegIslandViaGS(), and playrho::d2::Step().
Length playrho::StepConf::targetDepth = DefaultLinearSlop * Real{3} |
Target depth.
Target depth of overlap for calculating the TOI for CCD eligible bodies.
Length playrho::StepConf::toiMinSeparation = -DefaultLinearSlop * Real(1.5f) |
Time of impact minimum separation.
This is the minimum amount of separation there must be between TOI-phase interacting bodies for intra-step position resolution to be considered successful and end before all of the TOI position iterations have been done.
Referenced by playrho::d2::WorldImpl::SolveToiViaGS().
iteration_type playrho::StepConf::toiPositionIterations = 20 |
TOI position iterations.
This value is the maximum number of iterations of position resolution that will be done before leaving any remaining unsatisfied positions for the next step. In this context, positions are satisfied when the minimum separation is greater than or equal to the TOI minimum separation amount.
Referenced by playrho::d2::WorldImpl::SolveToiViaGS(), and playrho::d2::Step().
Time of impact resolution rate.
This scale factor controls how fast positional overlap is resolved. Ideally this would be 1 so that overlap is removed in one time step. However using values close to 1 often lead to overshoot.
iteration_type playrho::StepConf::toiVelocityIterations = 8 |
TOI velocity iterations.
This is the number of iterations of velocity resolution that will be done in the step.
Referenced by playrho::d2::WorldImpl::SolveToiViaGS(), and playrho::d2::Step().
NonNegative<Length> playrho::StepConf::tolerance = DefaultLinearSlop / Real{4} |
Tolerance.
The acceptable plus or minus tolerance from the target depth for TOI calculations.
LinearVelocity playrho::StepConf::velocityThreshold = DefaultVelocityThreshold |
Velocity threshold.
A velocity threshold for elastic collisions. Any collision with a relative linear velocity below this threshold will be treated as inelastic.