PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::Position Struct Reference

2-D positional data structure. More...

#include <Position.hpp>

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

Public Attributes

Length2 linear
 Linear position.
 
Angle angular
 Angular position.
 

Related Functions

(Note that these are not member functions.)

constexpr bool operator== (const Position &lhs, const Position &rhs)
 Equality operator.
 
constexpr bool operator!= (const Position &lhs, const Position &rhs)
 Inequality operator.
 
constexpr Position operator- (const Position &value)
 Negation 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)
 Addition operator.
 
constexpr Positionoperator-= (Position &lhs, const Position &rhs)
 Subtraction assignment operator.
 
constexpr Position operator- (const Position &lhs, const Position &rhs)
 Subtraction operator.
 
constexpr Position operator* (const Real scalar, const Position &pos)
 Multiplication operator.
 
template<>
constexpr bool IsValid (const d2::Position &value) noexcept
 Determines if the given value is valid.
 
constexpr Position GetPosition (const Position pos0, const Position pos1, const Real beta) noexcept
 Gets the position between two positions at a given unit interval. More...
 

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.

Note
This structure is likely to be 12-bytes large (at least on 64-bit platforms).
Examples
Body.cpp, PulleyJoint.cpp, TargetJoint.cpp, and WorldBody.cpp.

Friends And Related Function Documentation

◆ GetPosition()

constexpr Position GetPosition ( const Position  pos0,
const Position  pos1,
const 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.
betaUnit interval (value between 0 and 1) 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.

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