Rigid Body Dynamics Library
Body Struct Reference

Describes all properties of a single body. More...

`#include <Body.h>`

## Public Member Functions

Body ()

Body (const Body &body)

Bodyoperator= (const Body &body)

Body (const Math::Scalar &mass, const Math::Vector3d &com, const Math::Vector3d &gyration_radii)
Constructs a body from mass, center of mass and radii of gyration. More...

Body (const Math::Scalar &mass, const Math::Vector3d &com, const Math::Matrix3d &inertia_C)
Constructs a body from mass, center of mass, and a 3x3 inertia matrix. More...

void Join (const Math::SpatialTransform &transform, const Body &other_body)
Joins inertial parameters of two bodies to create a composite body. More...

~Body ()

## Data Fields

Math::Scalar mMass
The mass of the body. More...

Math::Vector3d mCenterOfMass
The position of the center of mass in body coordinates. More...

Math::Matrix3d mInertia
Inertia matrix at the center of mass. More...

bool mIsVirtual

## Detailed Description

Describes all properties of a single body.

A Body contains information about mass, the location of its center of mass, and the ineria tensor in the center of mass. This class is designed to use the given information and transform it such that it can directly be used by the spatial algebra.

Definition at line 28 of file Body.h.

## ◆ Body() [1/4]

 Body ( )
inline

Definition at line 29 of file Body.h.

## ◆ Body() [2/4]

 Body ( const Body & body )
inline

Definition at line 35 of file Body.h.

## ◆ Body() [3/4]

 Body ( const Math::Scalar & mass, const Math::Vector3d & com, const Math::Vector3d & gyration_radii )
inline

Constructs a body from mass, center of mass and radii of gyration.

This constructor eases the construction of a new body as all the required parameters can be specified as parameters to the constructor. These are then used to generate the spatial inertia matrix which is expressed at the origin.

Parameters
 mass the mass of the body com the position of the center of mass in the bodies coordinates gyration_radii the radii of gyration at the center of mass of the body

Definition at line 64 of file Body.h.

## ◆ Body() [4/4]

 Body ( const Math::Scalar & mass, const Math::Vector3d & com, const Math::Matrix3d & inertia_C )
inline

Constructs a body from mass, center of mass, and a 3x3 inertia matrix.

This constructor eases the construction of a new body as all the required parameters can simply be specified as parameters to the constructor. These are then used to generate the spatial inertia matrix which is expressed at the origin.

Parameters
 mass the mass of the body com the position of the center of mass in the bodies coordinates inertia_C the inertia at the center of mass

Definition at line 89 of file Body.h.

## ◆ ~Body()

 ~Body ( )
inline

Definition at line 190 of file Body.h.

## ◆ Join()

 void Join ( const Math::SpatialTransform & transform, const Body & other_body )
inline

Joins inertial parameters of two bodies to create a composite body.

This function can be used to joint inertial parameters of two bodies to create a composite body that has the inertial properties as if the two bodies were joined by a fixed joint.

Parameters
 transform The frame transformation from the current body to the other body. other_body The other body that will be merged with *this.

Definition at line 108 of file Body.h.

## ◆ operator=()

 Body & operator= ( const Body & body )
inline

Definition at line 41 of file Body.h.

References Body::mCenterOfMass, Body::mInertia, Body::mIsVirtual, and Body::mMass.

## ◆ mCenterOfMass

 Math::Vector3d mCenterOfMass

The position of the center of mass in body coordinates.

Definition at line 195 of file Body.h.

## ◆ mInertia

 Math::Matrix3d mInertia

Inertia matrix at the center of mass.

Definition at line 197 of file Body.h.

## ◆ mIsVirtual

 bool mIsVirtual

Definition at line 199 of file Body.h.

## ◆ mMass

 Math::Scalar mMass

The mass of the body.

Definition at line 193 of file Body.h.

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