playrho::d2::Velocity Struct Reference

2-D velocity related data structure. More...

#include <Velocity.hpp>

Public Attributes

LinearVelocity2 linear
 Linear velocity. More...
 
AngularVelocity angular
 Angular velocity. More...
 

Related Functions

(Note that these are not member functions.)

PLAYRHO_CONSTEXPR bool operator== (const Velocity &lhs, const Velocity &rhs)
 Equality operator. More...
 
PLAYRHO_CONSTEXPR bool operator!= (const Velocity &lhs, const Velocity &rhs)
 Inequality operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator*= (Velocity &lhs, const Real rhs)
 Multiplication assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator/= (Velocity &lhs, const Real rhs)
 Division assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator+= (Velocity &lhs, const Velocity &rhs)
 Addition assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator+ (const Velocity &lhs, const Velocity &rhs)
 Addition operator. More...
 
PLAYRHO_CONSTEXPR Velocityoperator-= (Velocity &lhs, const Velocity &rhs)
 Subtraction assignment operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator- (const Velocity &lhs, const Velocity &rhs)
 Subtraction operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator- (const Velocity &value)
 Negation operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator+ (const Velocity &value)
 Positive operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator* (const Velocity &lhs, const Real rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator* (const Real lhs, const Velocity &rhs)
 Multiplication operator. More...
 
PLAYRHO_CONSTEXPR Velocity operator/ (const Velocity &lhs, const Real rhs)
 Division operator. More...
 
template<>
PLAYRHO_CONSTEXPR bool IsValid (const d2::Velocity &value) noexcept
 Determines if the given value is valid. More...
 
Velocity Cap (Velocity velocity, Time h, MovementConf conf) noexcept
 Caps velocity. More...
 

Detailed Description

2-D velocity related data structure.

Note
This data structure is 12-bytes (with 4-byte Real on at least one 64-bit platform).
Examples
Body.cpp, and World.cpp.

Definition at line 35 of file Velocity.hpp.

Friends And Related Function Documentation

◆ operator==()

PLAYRHO_CONSTEXPR bool operator== ( const Velocity lhs,
const Velocity rhs 
)
related

Equality operator.

Definition at line 43 of file Velocity.hpp.

◆ operator!=()

PLAYRHO_CONSTEXPR bool operator!= ( const Velocity lhs,
const Velocity rhs 
)
related

Inequality operator.

Definition at line 50 of file Velocity.hpp.

◆ operator*=()

PLAYRHO_CONSTEXPR Velocity & operator*= ( Velocity lhs,
const Real  rhs 
)
related

Multiplication assignment operator.

Definition at line 57 of file Velocity.hpp.

◆ operator/=()

PLAYRHO_CONSTEXPR Velocity & operator/= ( Velocity lhs,
const Real  rhs 
)
related

Division assignment operator.

Definition at line 66 of file Velocity.hpp.

◆ operator+=()

PLAYRHO_CONSTEXPR Velocity & operator+= ( Velocity lhs,
const Velocity rhs 
)
related

Addition assignment operator.

Definition at line 75 of file Velocity.hpp.

◆ operator+() [1/2]

PLAYRHO_CONSTEXPR Velocity operator+ ( const Velocity lhs,
const Velocity rhs 
)
related

Addition operator.

Definition at line 84 of file Velocity.hpp.

◆ operator-=()

PLAYRHO_CONSTEXPR Velocity & operator-= ( Velocity lhs,
const Velocity rhs 
)
related

Subtraction assignment operator.

Definition at line 91 of file Velocity.hpp.

◆ operator-() [1/2]

PLAYRHO_CONSTEXPR Velocity operator- ( const Velocity lhs,
const Velocity rhs 
)
related

Subtraction operator.

Definition at line 100 of file Velocity.hpp.

◆ operator-() [2/2]

PLAYRHO_CONSTEXPR Velocity operator- ( const Velocity value)
related

Negation operator.

Definition at line 107 of file Velocity.hpp.

◆ operator+() [2/2]

PLAYRHO_CONSTEXPR Velocity operator+ ( const Velocity value)
related

Positive operator.

Definition at line 114 of file Velocity.hpp.

◆ operator*() [1/2]

PLAYRHO_CONSTEXPR Velocity operator* ( const Velocity lhs,
const Real  rhs 
)
related

Multiplication operator.

Definition at line 121 of file Velocity.hpp.

◆ operator*() [2/2]

PLAYRHO_CONSTEXPR Velocity operator* ( const Real  lhs,
const Velocity rhs 
)
related

Multiplication operator.

Definition at line 128 of file Velocity.hpp.

◆ operator/()

PLAYRHO_CONSTEXPR Velocity operator/ ( const Velocity lhs,
const Real  rhs 
)
related

Division operator.

Definition at line 135 of file Velocity.hpp.

◆ IsValid()

PLAYRHO_CONSTEXPR bool IsValid ( const d2::Velocity value)
related

Determines if the given value is valid.

Definition at line 152 of file Velocity.hpp.

◆ Cap()

Velocity Cap ( Velocity  velocity,
Time  h,
MovementConf  conf 
)
related

Caps velocity.

Enforces maximums on the given velocity.

Parameters
velocityVelocity to cap. Behavior is undefined if this value is invalid.
hTime elapsed to get velocity for. Behavior is undefined if this value is invalid.
confMovement configuration. This defines caps on linear and angular speeds.

Definition at line 482 of file Body.cpp.

Member Data Documentation

◆ linear

LinearVelocity2 playrho::d2::Velocity::linear

Linear velocity.

Definition at line 37 of file Velocity.hpp.

◆ angular

AngularVelocity playrho::d2::Velocity::angular

Angular velocity.

Definition at line 38 of file Velocity.hpp.


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