Time of impact configuration. More...
#include <TimeOfImpact.hpp>
Public Types | |
using | root_iter_type = std::remove_const< decltype(DefaultMaxToiRootIters)>::type |
Root iteration type. | |
using | toi_iter_type = std::remove_const< decltype(DefaultMaxToiIters)>::type |
TOI iteration type. | |
using | dist_iter_type = std::remove_const< decltype(DefaultMaxDistanceIters)>::type |
Distance iteration type. | |
Public Member Functions | |
constexpr ToiConf & | UseTimeMax (Real value) noexcept |
Uses the given time max value. | |
constexpr ToiConf & | UseTargetDepth (Length value) noexcept |
Uses the given target depth value. | |
constexpr ToiConf & | UseTolerance (NonNegative< Length > value) noexcept |
Uses the given tolerance value. | |
constexpr ToiConf & | UseMaxRootIters (root_iter_type value) noexcept |
Uses the given max root iterations value. | |
constexpr ToiConf & | UseMaxToiIters (toi_iter_type value) noexcept |
Uses the given max TOI iterations value. | |
constexpr ToiConf & | UseMaxDistIters (dist_iter_type value) noexcept |
Uses the given max distance iterations value. | |
Public Attributes | |
Real | tMax = 1 |
T-Max. | |
Length | targetDepth = DefaultLinearSlop * Real{3} |
Targeted depth of impact. More... | |
NonNegative< Length > | tolerance = NonNegative<Length>{DefaultLinearSlop / Real{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. | |
dist_iter_type | maxDistIters = DefaultMaxDistanceIters |
Max distance iterations. | |
Related Functions | |
(Note that these are not member functions.) | |
constexpr auto | GetDefaultToiConf () |
Gets the default time of impact configuration. | |
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.
totalRadius - DefaultLinearSlop * x
where x is <= 1
is increasingly slower as x goes below 1. root_iter_type playrho::ToiConf::maxRootIters = DefaultMaxToiRootIters |
Maximum number of root finder iterations.
This is the maximum number of iterations for calculating the 1-dimensional 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.
Referenced by playrho::d2::GetToiViaSat().
Length playrho::ToiConf::targetDepth = DefaultLinearSlop * Real{3} |
Targeted depth of impact.
Referenced by playrho::d2::GetToiViaSat().
NonNegative<Length> playrho::ToiConf::tolerance = NonNegative<Length>{DefaultLinearSlop / Real{4}} |
Tolerance.
Provides a +/- range from the target depth that defines a minimum and maximum target depth within which inclusively, time of impact calculating code is expected to return a "touching" status.
Referenced by playrho::d2::GetToiViaSat().