playrho::d2::Sweep Class Reference
Description of a "sweep" of motion in 2-D space. More...
#include <Sweep.hpp>
Public Member Functions | |
Sweep ()=default | |
Default constructor. More... | |
PLAYRHO_CONSTEXPR | Sweep (const Sweep ©)=default |
Copy constructor. More... | |
PLAYRHO_CONSTEXPR | Sweep (const Position p0, const Position p1, const Length2 lc=Length2{0_m, 0_m}, Real a0=0) noexcept |
Initializing constructor. More... | |
PLAYRHO_CONSTEXPR | Sweep (const Position p, const Length2 lc=Length2{0_m, 0_m}) |
Initializing constructor. More... | |
Length2 | GetLocalCenter () const noexcept |
Gets the local center of mass position. More... | |
Real | GetAlpha0 () const noexcept |
Gets the alpha 0 for this sweep. More... | |
void | Advance0 (Real alpha) noexcept |
Advances the sweep by a factor of the difference between the given time alpha and the sweep's alpha 0. More... | |
void | ResetAlpha0 () noexcept |
Resets the alpha 0 value back to zero. More... | |
Public Attributes | |
Position | pos0 |
Center world position and world angle at time "0". More... | |
Position | pos1 |
Center world position and world angle at time "1". More... | |
Related Functions | |
(Note that these are not member functions.) | |
Sweep | GetNormalized (Sweep sweep) noexcept |
Gets a sweep with the given sweep's angles normalized. More... | |
Detailed Description
Description of a "sweep" of motion in 2-D space.
This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may not coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.
- Note
- This data structure is likely 36-bytes (at least on 64-bit platforms).
Constructor & Destructor Documentation
◆ Sweep() [1/4]
|
default |
Default constructor.
◆ Sweep() [2/4]
|
inlinedefault |
Copy constructor.
◆ Sweep() [3/4]
◆ Sweep() [4/4]
|
inlineexplicit |
Member Function Documentation
◆ GetLocalCenter()
|
inlinenoexcept |
◆ GetAlpha0()
|
inlinenoexcept |
◆ Advance0()
|
inlinenoexcept |
Advances the sweep by a factor of the difference between the given time alpha and the sweep's alpha 0.
This advances position 0 (pos0
) of the sweep towards position 1 (pos1
) by a factor of the difference between the given alpha and the alpha 0.
- Parameters
-
alpha Valid new time factor in [0,1) to update the sweep to. Behavior is undefined if value is invalid.
◆ ResetAlpha0()
|
inlinenoexcept |
Friends And Related Function Documentation
◆ GetNormalized()
Member Data Documentation
◆ pos0
Position playrho::d2::Sweep::pos0 |
◆ pos1
Position playrho::d2::Sweep::pos1 |
The documentation for this class was generated from the following files: