PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::BodyConstraint Class Reference

Constraint for a body. More...

#include <playrho/d2/BodyConstraint.hpp>

Public Member Functions

constexpr BodyConstraint (InvMass invMass, InvRotInertia invRotI, const Length2 &localCenter, const Position &position, const Velocity &velocity) noexcept
 Initializing constructor. More...
 
InvMass GetInvMass () const noexcept
 Gets the inverse mass of this body representation. More...
 
InvRotInertia GetInvRotInertia () const noexcept
 Gets the inverse rotational inertia of this body representation. More...
 
Length2 GetLocalCenter () const noexcept
 Gets the location of the body's center of mass in local coordinates.
 
Position GetPosition () const noexcept
 Gets the position of the body.
 
Velocity GetVelocity () const noexcept
 Gets the velocity of the body.
 
BodyConstraintSetPosition (const Position &value) noexcept
 Sets the position of the body. More...
 
BodyConstraintSetVelocity (const Velocity &value) noexcept
 Sets the velocity of the body. More...
 

Detailed Description

Constraint for a body.

Data related to body constraint processing.

Note
Only position and velocity is independently changeable after construction.

Constructor & Destructor Documentation

◆ BodyConstraint()

constexpr playrho::d2::BodyConstraint::BodyConstraint ( InvMass  invMass,
InvRotInertia  invRotI,
const Length2 localCenter,
const Position position,
const Velocity velocity 
)
inlineconstexprnoexcept

Initializing constructor.

Parameters
invMassInverse mass.
invRotIInverse rotational inertia.
localCenterLocal center.
positionPosition of the body.
velocityVelocity of the body.
Precondition
position, velocity, and locatCenter are all valid.
invMass and invRotI are greater-than or equal-to zero.

Member Function Documentation

◆ GetInvMass()

InvMass playrho::d2::BodyConstraint::GetInvMass ( ) const
inlinenoexcept

Gets the inverse mass of this body representation.

Returns
Value >= 0.

◆ GetInvRotInertia()

InvRotInertia playrho::d2::BodyConstraint::GetInvRotInertia ( ) const
inlinenoexcept

Gets the inverse rotational inertia of this body representation.

Returns
Value >= 0.

◆ SetPosition()

BodyConstraint & playrho::d2::BodyConstraint::SetPosition ( const Position value)
inlinenoexcept

Sets the position of the body.

Parameters
valueA valid position value to set for the represented body.
Precondition
value is valid - i.e. IsValid(value) is true.
Postcondition
GetPosition() returns the value to be set.
See also
GetPosition.

◆ SetVelocity()

BodyConstraint & playrho::d2::BodyConstraint::SetVelocity ( const Velocity value)
inlinenoexcept

Sets the velocity of the body.

Parameters
valueA valid velocity value to set for the represented body.
Precondition
value is valid - i.e. IsValid(value) is true.
Postcondition
GetVelocity() returns the value to be set.
See also
GetVelocity.

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