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

Constraint for a body. More...

#include <BodyConstraint.hpp>

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

Public Member Functions

constexpr BodyConstraint (InvMass invMass, InvRotInertia invRotI, Length2 localCenter, Position position, Velocity velocity) noexcept
 Initializing constructor.
 
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 (Position value) noexcept
 Sets the position of the body. More...
 
BodyConstraintSetVelocity (Velocity value) noexcept
 Sets the velocity of the body. More...
 

Private Attributes

Position m_position
 Position data of body.
 
Velocity m_velocity
 Velocity data of body.
 
Length2 m_localCenter
 Local center of the associated body's sweep.
 
InvMass m_invMass
 Inverse mass of associated body (a non-negative value).
 
InvRotInertia m_invRotI
 Inverse rotational inertia about the center of mass of the associated body (a non-negative value).
 

Detailed Description

Constraint for a body.

Data related to body 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).
Examples
PulleyJoint.cpp, and TargetJoint.cpp.

Member Function Documentation

◆ GetInvMass()

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

Gets the inverse mass of this body representation.

Returns
Value >= 0.

Referenced by playrho::d2::GetBodyConstraint().

◆ GetInvRotInertia()

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

Gets the inverse rotational inertia of this body representation.

Returns
Value >= 0.

Referenced by playrho::d2::GetBodyConstraint().

◆ 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.

◆ 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.

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