playrho::d2::BodyConstraint Class Reference

Body Constraint. More...

#include <BodyConstraint.hpp>

Public Types

using index_type = std::remove_const< decltype(MaxBodies)>::type
 Index type. More...
 

Public Member Functions

 BodyConstraint ()=default
 
PLAYRHO_CONSTEXPR BodyConstraint (InvMass invMass, InvRotInertia invRotI, Length2 localCenter, Position position, 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. More...
 
Position GetPosition () const noexcept
 Gets the position of the body. More...
 
Velocity GetVelocity () const noexcept
 Gets the velocity of the body. More...
 
BodyConstraintSetPosition (Position value) noexcept
 Sets the position of the body. More...
 
BodyConstraintSetVelocity (Velocity value) noexcept
 Sets the velocity of the body. More...
 

Detailed Description

Body Constraint.

Body data related to constraint processing.

Note
Only position and velocity is independently changeable after construction.
This data structure is 40-bytes large (with 4-byte Real on at least one 64-bit platform).

Definition at line 35 of file BodyConstraint.hpp.

Member Typedef Documentation

◆ index_type

using playrho::d2::BodyConstraint::index_type = std::remove_const<decltype(MaxBodies)>::type

Index type.

Definition at line 41 of file BodyConstraint.hpp.

Constructor & Destructor Documentation

◆ BodyConstraint() [1/2]

playrho::d2::BodyConstraint::BodyConstraint ( )
default

◆ BodyConstraint() [2/2]

PLAYRHO_CONSTEXPR playrho::d2::BodyConstraint::BodyConstraint ( InvMass  invMass,
InvRotInertia  invRotI,
Length2  localCenter,
Position  position,
Velocity  velocity 
)
inlinenoexcept

Initializing constructor.

Definition at line 47 of file BodyConstraint.hpp.

Member Function Documentation

◆ GetInvMass()

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

Gets the inverse mass of this body representation.

Returns
Value >= 0.

Definition at line 100 of file BodyConstraint.hpp.

◆ GetInvRotInertia()

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

Gets the inverse rotational inertia of this body representation.

Returns
Value >= 0.

Definition at line 105 of file BodyConstraint.hpp.

◆ GetLocalCenter()

Length2 playrho::d2::BodyConstraint::GetLocalCenter ( ) const
inlinenoexcept

Gets the location of the body's center of mass in local coordinates.

Definition at line 110 of file BodyConstraint.hpp.

◆ GetPosition()

Position playrho::d2::BodyConstraint::GetPosition ( ) const
inlinenoexcept

Gets the position of the body.

Definition at line 115 of file BodyConstraint.hpp.

◆ GetVelocity()

Velocity playrho::d2::BodyConstraint::GetVelocity ( ) const
inlinenoexcept

Gets the velocity of the body.

Definition at line 120 of file BodyConstraint.hpp.

◆ SetPosition()

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

Sets the position of the body.

Parameters
valueA valid position value to set for the represented body.
Warning
Behavior is undefined if the given value is not valid.

Definition at line 125 of file BodyConstraint.hpp.

◆ SetVelocity()

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

Sets the velocity of the body.

Parameters
valueA valid velocity value to set for the represented body.
Warning
Behavior is undefined if the given value is not valid.

Definition at line 132 of file BodyConstraint.hpp.


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