PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::Position Struct Reference

2-D positional data structure. More...

#include <playrho/d2/Position.hpp>

Collaboration diagram for playrho::d2::Position:
[legend]

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 Positionoperator+= (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 Positionoperator-= (Position &lhs, const Position &rhs)
 Subtraction assignment operator.
 
constexpr bool operator== (const Position &lhs, const Position &rhs)
 Equality operator.
 

Detailed Description

2-D positional data structure.

A 2-element length and angle pair suitable for representing a linear and angular position in 2-D.

Friends And Related Function Documentation

◆ GetPosition()

Position GetPosition ( const Position pos0,
const Position pos1,
Real  beta 
)
related

Gets the position between two positions at a given unit interval.

Parameters
pos0Position at unit interval value of 0.
pos1Position at unit interval value of 1.
betaRatio of travel between position 0 and position 1.
Returns
position 0 if 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().


The documentation for this struct was generated from the following files: