Output data for time of impact. More...
#include <TimeOfImpact.hpp>
Classes | |
struct | Statistics |
Time of impact statistics. More... | |
Public Types | |
enum | State : std::uint8_t { e_unknown, e_touching, e_separated, e_overlapped, e_maxRootIters, e_nextAfter, e_maxToiIters, e_belowMinTarget, e_maxDistIters, e_targetDepthExceedsTotalRadius, e_minTargetSquaredOverflow, e_maxTargetSquaredOverflow, e_notFinite } |
State. More... | |
Public Member Functions | |
TOIOutput ()=default | |
Default constructor. More... | |
TOIOutput (Real t, Statistics s, State z) noexcept | |
Initializing constructor. More... | |
Public Attributes | |
Real | time = 0 |
Time factor in range of [0,1] into the future. More... | |
Statistics | stats |
Statistics. More... | |
State | state = e_unknown |
State at time factor. More... | |
Related Functions | |
(Note that these are not member functions.) | |
TOIOutput | GetToiViaSat (const DistanceProxy &proxyA, const Sweep &sweepA, const DistanceProxy &proxyB, const Sweep &sweepB, ToiConf conf=GetDefaultToiConf()) |
Gets the time of impact for two disjoint convex sets using the Separating Axis Theorem. More... | |
Detailed Description
Output data for time of impact.
Definition at line 156 of file TimeOfImpact.hpp.
Member Enumeration Documentation
◆ State
enum playrho::TOIOutput::State : std::uint8_t |
State.
Definition at line 191 of file TimeOfImpact.hpp.
Constructor & Destructor Documentation
◆ TOIOutput() [1/2]
|
default |
Default constructor.
◆ TOIOutput() [2/2]
|
inlinenoexcept |
Initializing constructor.
Definition at line 254 of file TimeOfImpact.hpp.
Friends And Related Function Documentation
◆ GetToiViaSat()
|
related |
Gets the time of impact for two disjoint convex sets using the Separating Axis Theorem.
Computes the upper bound on time before two shapes penetrate too much. Time is represented as a fraction between [0,tMax
]. This uses a swept separating axis and may miss some intermediate, non-tunneling collision. If you change the time interval, you should call this function again.
- Precondition
- The given sweeps are both at the same alpha-0.
- Warning
- Behavior is undefined if sweeps are not at the same alpha-0.
-
Behavior is undefined if the configuration's
tMax
is not between 0 and 1 inclusive.
- Note
- Uses Distance to compute the contact point and normal at the time of impact.
- This only works for two disjoint convex sets.
- Parameters
-
proxyA Proxy A. The proxy's vertex count must be 1 or more. sweepA Sweep A. Sweep of motion for shape represented by proxy A. proxyB Proxy B. The proxy's vertex count must be 1 or more. sweepB Sweep B. Sweep of motion for shape represented by proxy B. conf Configuration details for on calculation. Like the targeted depth of penetration.
- Returns
- Time of impact output data.
Member Data Documentation
◆ time
Real playrho::TOIOutput::time = 0 |
Time factor in range of [0,1] into the future.
Definition at line 256 of file TimeOfImpact.hpp.
◆ stats
Statistics playrho::TOIOutput::stats |
Definition at line 257 of file TimeOfImpact.hpp.
◆ state
State at time factor.
Definition at line 258 of file TimeOfImpact.hpp.
The documentation for this struct was generated from the following file:
- Collision/TimeOfImpact.hpp