Description of a "sweep" of motion in 2-D space. More...
#include <playrho/d2/Sweep.hpp>
Public Member Functions | |
constexpr | Sweep ()=default |
Default constructor. More... | |
constexpr | Sweep (const Position &p, const Length2 &lc=Length2{0_m, 0_m}) |
Initializing constructor. More... | |
constexpr | Sweep (const Position &p0, const Position &p1, const Length2 &lc=Length2{0_m, 0_m}, ZeroToUnderOneFF< Real > a0={}) noexcept |
Initializing constructor. More... | |
Public Attributes | |
ZeroToUnderOneFF< Real > | alpha0 |
Alpha 0 of this sweep. More... | |
Length2 | localCenter = Length2{0_m, 0_m} |
Local center of mass position. | |
Position | pos0 {} |
Center world position and world angle at time "0". | |
Position | pos1 {} |
Center world position and world angle at time "1". | |
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... | |
constexpr auto | IsValid (const d2::Sweep &value) noexcept -> bool |
Determines if the given value is valid. | |
constexpr bool | operator!= (const Sweep &lhs, const Sweep &rhs) |
Not-equals operator. | |
constexpr bool | operator== (const Sweep &lhs, const Sweep &rhs) |
Equals operator. | |
void | SetLocalCenter (Sweep &sweep, const Length2 &value) noexcept |
Convenience function for setting the sweep's local center. | |
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.
|
constexprdefault |
|
inlineconstexprnoexcept |
Initializing constructor.
p0 | Value for position 0. |
p1 | Value for position 1. |
lc | Local center. |
a0 | Alpha 0 for the sweep. |
pos0
is the value of p0
. pos1
is the value of p1
. localCenter
is the value of lc
. alpha0
is the value of a0
.
|
inlineexplicitconstexpr |
Initializing constructor.
pos0
is the value of p
. pos1
is the value of p
. localCenter
is the value of lc
. alpha0
is zero. ZeroToUnderOneFF<Real> playrho::d2::Sweep::alpha0 |
Alpha 0 of this sweep.
Fraction of the current time step in the range [0,1)
pos0.linear
and pos0.angular
are the positions at alpha0
. Referenced by operator==(), and playrho::d2::Body::ResetAlpha0().