2-D positional data structure. More...
#include <playrho/d2/Position.hpp>
Public Member Functions | |
constexpr | Position () noexcept=default |
Default constructor. | |
constexpr | Position (Length2 l, Angle a=0_deg) noexcept |
Initializing constructor. | |
Public Attributes | |
Angle | angular {} |
Angular position. | |
Length2 | linear {} |
Linear position. | |
Related Functions | |
(Note that these are not member functions.) | |
Position | Cap (Position pos, const ConstraintSolverConf &conf) |
Caps the given position by the amounts specified in the given configuration. | |
Position | GetPosition (const Position &pos0, const Position &pos1, Real beta) noexcept |
constexpr auto | IsValid (const d2::Position &value) noexcept -> bool |
Determines if the given value is valid. | |
constexpr bool | operator!= (const Position &lhs, const Position &rhs) |
Inequality operator. | |
constexpr Position | operator* (const Real scalar, const Position &pos) |
Multiplication operator. | |
constexpr Position | operator+ (const Position &lhs, const Position &rhs) |
Addition operator. | |
constexpr Position | operator+ (const Position &value) |
Positive operator. | |
constexpr Position & | operator+= (Position &lhs, const Position &rhs) |
Addition assignment operator. | |
constexpr Position | operator- (const Position &lhs, const Position &rhs) |
Subtraction operator. | |
constexpr Position | operator- (const Position &value) |
Negation operator. | |
constexpr Position & | operator-= (Position &lhs, const Position &rhs) |
Subtraction assignment operator. | |
constexpr bool | operator== (const Position &lhs, const Position &rhs) |
Equality operator. | |
2-D positional data structure.
A 2-element length and angle pair suitable for representing a linear and angular position in 2-D.
Gets the position between two positions at a given unit interval.
pos0 | Position at unit interval value of 0. |
pos1 | Position at unit interval value of 1. |
beta | Ratio of travel between position 0 and position 1. |
pos0 == pos1
or beta == 0
, position 1 if beta == 1
, or at the given unit interval value between position 0 and position 1. Referenced by playrho::GaussSeidel::SolvePositionConstraint().