Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Types | Public Member Functions | Public Attributes | List of all members
box2d::ToiConf Struct Reference

Time of impact configuration. More...

#include <TimeOfImpact.hpp>

Public Types

using root_iter_type = std::remove_const< decltype(DefaultMaxToiRootIters)>::type
 
using toi_iter_type = std::remove_const< decltype(DefaultMaxToiIters)>::type
 
using dist_iter_type = std::remove_const< decltype(DefaultMaxDistanceIters)>::type
 

Public Member Functions

constexpr ToiConfUseTimeMax (RealNum value) noexcept
 
constexpr ToiConfUseTargetDepth (Length value) noexcept
 
constexpr ToiConfUseTolerance (Length value) noexcept
 
constexpr ToiConfUseMaxRootIters (root_iter_type value) noexcept
 
constexpr ToiConfUseMaxToiIters (toi_iter_type value) noexcept
 
constexpr ToiConfUseMaxDistIters (dist_iter_type value) noexcept
 

Public Attributes

RealNum tMax = 1
 
Length targetDepth = DefaultLinearSlop * RealNum{3}
 Targetted depth of impact. More...
 
Length tolerance = DefaultLinearSlop / RealNum{4}
 Tolerance. More...
 
root_iter_type maxRootIters = DefaultMaxToiRootIters
 Maximum number of root finder iterations. More...
 
toi_iter_type maxToiIters = DefaultMaxToiIters
 Max time of impact iterations. More...
 
dist_iter_type maxDistIters = DefaultMaxDistanceIters
 

Detailed Description

Time of impact configuration.

These parameters effect time of impact calculations by limiting the definitions of time and impact. If total radius is expressed as TR, and target depth as TD, then: the max target distance is (TR - TD) + tolerance; and the min target distance is (TR - TD) - tolerance.

Note
Max target distance must be less than or equal to the total radius as the target range has to be chosen such that the contact manifold will have a greater than zero contact point count.
A max target of totalRadius - DefaultLinearSlop * x where x is <= 1 is increasingly slower as x goes below 1.
Min target distance needs to be significantly less than the max target distance and significantly more than 0.
See also
SolvePositionConstraints
SolveTOIPositionConstraints

Member Typedef Documentation

◆ dist_iter_type

using box2d::ToiConf::dist_iter_type = std::remove_const<decltype(DefaultMaxDistanceIters)>::type

◆ root_iter_type

using box2d::ToiConf::root_iter_type = std::remove_const<decltype(DefaultMaxToiRootIters)>::type

◆ toi_iter_type

using box2d::ToiConf::toi_iter_type = std::remove_const<decltype(DefaultMaxToiIters)>::type

Member Function Documentation

◆ UseMaxDistIters()

constexpr ToiConf & box2d::ToiConf::UseMaxDistIters ( dist_iter_type  value)
noexcept

◆ UseMaxRootIters()

constexpr ToiConf & box2d::ToiConf::UseMaxRootIters ( root_iter_type  value)
noexcept

◆ UseMaxToiIters()

constexpr ToiConf & box2d::ToiConf::UseMaxToiIters ( toi_iter_type  value)
noexcept

◆ UseTargetDepth()

constexpr ToiConf & box2d::ToiConf::UseTargetDepth ( Length  value)
noexcept

◆ UseTimeMax()

constexpr ToiConf & box2d::ToiConf::UseTimeMax ( RealNum  value)
noexcept

◆ UseTolerance()

constexpr ToiConf & box2d::ToiConf::UseTolerance ( Length  value)
noexcept

Member Data Documentation

◆ maxDistIters

dist_iter_type box2d::ToiConf::maxDistIters = DefaultMaxDistanceIters

◆ maxRootIters

root_iter_type box2d::ToiConf::maxRootIters = DefaultMaxToiRootIters

Maximum number of root finder iterations.

This is the maximum number of iterations for calculating the 1D root of f(t) - (totalRadius - targetDepth) < tolerance where f(t) is the distance between the shapes at time t, and totalRadius is the sum of the vertex radiuses of 2 distance proxies.

Note
This value never needs to be more than the number of iterations needed to achieve full machine precision.

◆ maxToiIters

toi_iter_type box2d::ToiConf::maxToiIters = DefaultMaxToiIters

Max time of impact iterations.

◆ targetDepth

Length box2d::ToiConf::targetDepth = DefaultLinearSlop * RealNum{3}

Targetted depth of impact.

Note
Value must be less than twice the minimum vertex radius of any shape.

◆ tMax

RealNum box2d::ToiConf::tMax = 1

◆ tolerance

Length box2d::ToiConf::tolerance = DefaultLinearSlop / RealNum{4}

Tolerance.


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