Step configuration. More...
#include <playrho/StepConf.hpp>
Public Types | |
using | iteration_type = TimestepIters |
Step iterations type. More... | |
Static Public Attributes | |
static constexpr auto | DefaultAabbExtension = Length{playrho::DefaultAabbExtension} |
Default abstract aligned bounding box (AABB) extension. | |
static constexpr auto | DefaultAngularSleepTolerance = AngularVelocity{playrho::DefaultAngularSleepTolerance} |
Default angular sleep tolerance. | |
static constexpr auto | DefaultAngularSlop = Positive<Angle>{playrho::DefaultAngularSlop} |
Default angular slop. | |
static constexpr auto | DefaultCirclesRatio = Real(playrho::DefaultCirclesRatio) |
Default curcles ratio. | |
static constexpr auto | DefaultDistanceMultiplier = Real(playrho::DefaultDistanceMultiplier) |
Default distance multiplier. | |
static constexpr auto | DefaultDoBlocksolve = true |
Default do block-solve processing value . | |
static constexpr auto | DefaultDoToi = true |
Default do time of impact (TOI) processing. | |
static constexpr auto | DefaultDoWarmStart = true |
Default do warm start processing. | |
static constexpr auto | DefaultDtRatio = Real(1) |
Default delta time ratio. | |
static constexpr auto | DefaultLinearSleepTolerance = LinearVelocity{playrho::DefaultLinearSleepTolerance} |
Default linear sleep tolerance. | |
static constexpr auto | DefaultLinearSlop = Positive<Length>{playrho::DefaultLinearSlop} |
Default linear slop. More... | |
static constexpr auto | DefaultMaxAngularCorrection = Angle{playrho::DefaultMaxAngularCorrection} |
Default max angular correction. | |
static constexpr auto | DefaultMaxDistanceIters = iteration_type{playrho::DefaultMaxDistanceIters} |
Default max distance iterations. | |
static constexpr auto | DefaultMaxLinearCorrection = Length{playrho::DefaultMaxLinearCorrection} |
Default max linear correction. | |
static constexpr auto | DefaultMaxRotation = Angle{playrho::DefaultMaxRotation} |
Default max rotation. | |
static constexpr auto | DefaultMaxSubSteps = iteration_type{playrho::DefaultMaxSubSteps} |
Default max sub-steps value. | |
static constexpr auto | DefaultMaxToiIters = iteration_type{playrho::DefaultMaxToiIters} |
Default max time of impact iterations. | |
static constexpr auto | DefaultMaxToiRootIters = iteration_type{playrho::DefaultMaxToiRootIters} |
Default max time of impact root iterations. | |
static constexpr auto | DefaultMaxTranslation = Length{playrho::DefaultMaxTranslation} |
Default max translation. | |
static constexpr auto | DefaultMinStillTimeToSleep = Time{playrho::DefaultMinStillTimeToSleep} |
Default min still time to sleep. | |
static constexpr auto | DefaultRegMinMomentum = Momentum{playrho::DefaultRegMinMomentum} |
Default regular min momentum. | |
static constexpr auto | DefaultRegMinSeparation = -playrho::DefaultLinearSlop * Real(3) |
Default regular min separation. | |
static constexpr auto | DefaultRegPositionIters = iteration_type{3} |
Default regular position iterations. | |
static constexpr auto | DefaultRegResolutionRate = Real(2) / 10 |
Default regular resolution rate. | |
static constexpr auto | DefaultRegVelocityIters = iteration_type{8} |
Default regular velocity iterations. | |
static constexpr auto | DefaultStepTime = Time{playrho::DefaultStepTime} |
Default step time. | |
static constexpr auto | DefaultTargetDepth = NonNegative<Length>{DefaultLinearSlop * Real(3)} |
Default target depth. More... | |
static constexpr auto | DefaultToiMinMomentum = Momentum{playrho::DefaultToiMinMomentum} |
Default time of impact (TOI) min momemtum. | |
static constexpr auto | DefaultToiMinSeparation = -playrho::DefaultLinearSlop * Real(1.5f) |
Default time of impact (TOI) min separation. | |
static constexpr auto | DefaultToiPositionIters = iteration_type{20} |
Default time of impact position iterations. | |
static constexpr auto | DefaultToiResolutionRate = Real(75) / 100 |
Default time of impact (TOI) resolution rate. | |
static constexpr auto | DefaultToiVelocityIters = iteration_type{8} |
Default time of impact velocity iterations. | |
static constexpr auto | DefaultTolerance = NonNegative<Length>{DefaultLinearSlop / Real(4)} |
Default tolerance. More... | |
static constexpr auto | DefaultVelocityThreshold = LinearVelocity{playrho::DefaultVelocityThreshold} |
Default velocity threshold. | |
static constexpr auto | InvalidIteration = static_cast<iteration_type>(-1) |
Invalid iteration value. | |
Related Functions | |
(Note that these are not member functions.) | |
Length | GetMaxRegLinearCorrection (const StepConf &conf) noexcept |
Gets the maximum regular linear correction from the given value. | |
MovementConf | GetMovementConf (const StepConf &conf) noexcept |
Gets the movement configuration from the given value. More... | |
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.
AngularVelocity playrho::StepConf::angularSleepTolerance = DefaultAngularSleepTolerance |
Angular sleep tolerance.
Positive<Angle> playrho::StepConf::angularSlop = DefaultAngularSlop |
Angular slop.
|
staticconstexpr |
Default linear slop.
|
staticconstexpr |
Default target depth.
|
staticconstexpr |
Default tolerance.
Time playrho::StepConf::deltaTime = DefaultStepTime |
Delta time.
This is the time step in seconds.
Referenced by playrho::d2::DistanceJointConf::InitVelocity(), playrho::d2::TargetJointConf::InitVelocity(), playrho::d2::WeldJointConf::InitVelocity(), playrho::d2::WheelJointConf::InitVelocity(), playrho::d2::FrictionJointConf::SolveVelocity(), playrho::d2::MotorJointConf::SolveVelocity(), playrho::d2::PrismaticJointConf::SolveVelocity(), playrho::d2::RevoluteJointConf::SolveVelocity(), playrho::d2::RopeJointConf::SolveVelocity(), playrho::d2::TargetJointConf::SolveVelocity(), playrho::d2::WheelJointConf::SolveVelocity(), and playrho::d2::World::Step().
bool playrho::StepConf::doToi = DefaultDoToi |
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.
bool playrho::StepConf::doWarmStart = DefaultDoWarmStart |
Do warm start.
Whether or not to perform warm starting (in the regular phase).
Referenced by playrho::d2::DistanceJointConf::InitVelocity(), playrho::d2::FrictionJointConf::InitVelocity(), playrho::d2::GearJointConf::InitVelocity(), playrho::d2::MotorJointConf::InitVelocity(), playrho::d2::PrismaticJointConf::InitVelocity(), playrho::d2::PulleyJointConf::InitVelocity(), playrho::d2::RevoluteJointConf::InitVelocity(), playrho::d2::RopeJointConf::InitVelocity(), playrho::d2::TargetJointConf::InitVelocity(), playrho::d2::WeldJointConf::InitVelocity(), and playrho::d2::WheelJointConf::InitVelocity().
Real playrho::StepConf::dtRatio = DefaultDtRatio |
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::DistanceJointConf::InitVelocity(), playrho::d2::FrictionJointConf::InitVelocity(), playrho::d2::MotorJointConf::InitVelocity(), playrho::d2::PrismaticJointConf::InitVelocity(), playrho::d2::PulleyJointConf::InitVelocity(), playrho::d2::RevoluteJointConf::InitVelocity(), playrho::d2::RopeJointConf::InitVelocity(), playrho::d2::TargetJointConf::InitVelocity(), playrho::d2::WeldJointConf::InitVelocity(), playrho::d2::WheelJointConf::InitVelocity(), and playrho::d2::World::Step().
LinearVelocity playrho::StepConf::linearSleepTolerance = DefaultLinearSleepTolerance |
Linear sleep tolerance.
Positive<Length> playrho::StepConf::linearSlop = DefaultLinearSlop |
Linear slop.
Linear slop for position resolution.
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.
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.
Length playrho::StepConf::regMinSeparation = DefaultRegMinSeparation |
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.
iteration_type playrho::StepConf::regPositionIters = DefaultRegPositionIters |
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::World::Step().
Real playrho::StepConf::regResolutionRate = DefaultRegResolutionRate |
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::regVelocityIters = DefaultRegVelocityIters |
Regular velocity iterations.
The number of iterations of velocity resolution that will be done in the step.
Referenced by playrho::d2::World::Step().
NonNegative<Length> playrho::StepConf::targetDepth = DefaultTargetDepth |
Target depth.
Target depth of overlap for calculating the TOI for CCD eligible bodies.
Length playrho::StepConf::toiMinSeparation = DefaultToiMinSeparation |
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.
iteration_type playrho::StepConf::toiPositionIters = DefaultToiPositionIters |
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::World::Step().
Real playrho::StepConf::toiResolutionRate = DefaultToiResolutionRate |
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::toiVelocityIters = DefaultToiVelocityIters |
TOI velocity iterations.
This is the number of iterations of velocity resolution that will be done in the step.
Referenced by playrho::d2::World::Step().
NonNegative<Length> playrho::StepConf::tolerance = DefaultTolerance |
Tolerance.
The acceptable plus or minus tolerance from the target depth for TOI calculations.
targetDepth
). 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.