A class implementing a Simbody body segment. More...
#include <Body.h>
Public Member Functions | |
virtual | ~Body () |
Destructor. | |
Body () | |
Default constructor. | |
Body (const std::string &aName, double aMass, const SimTK::Vec3 &aMassCenter, const SimTK::Inertia &aInertia) | |
Constructor. | |
Body (const Body &aBody) | |
Copy constructor. | |
virtual Object * | copy () const |
Copy constructor from an AbstractBody. | |
Body & | operator= (const Body &aBody) |
Assignment operator. | |
void | copyData (const Body &aBody) |
Copy data members from one Body to another. | |
virtual void | setup (Model &aModel) |
Perform some set up functions that happen after the object has been deserialized or copied. | |
virtual void | addDisplayGeometry (const std::string &aGeometryFileName) |
Add display geometry to body. | |
virtual double | getMass () const |
Get the mass of the body. | |
virtual bool | setMass (double aMass) |
Set the mass of the body. | |
virtual void | getMassCenter (SimTK::Vec3 &rVec) const |
Get the mass center of the body. | |
virtual bool | setMassCenter (const SimTK::Vec3 &aVec) |
Set the mass center of the body. | |
virtual void | getInertia (SimTK::Mat33 &rInertia) const |
Get the inertia matrix of the body. | |
virtual bool | setInertia (const SimTK::Inertia &aInertia) |
Set the inertia matrix of the body. | |
virtual bool | hasJoint () const |
virtual Joint & | getJoint () const |
virtual void | setJoint (Joint &aJoint) |
Set the joint for this body. | |
virtual void | scale (const SimTK::Vec3 &aScaleFactors, bool aScaleMass=false) |
Scale the body. | |
virtual void | scaleInertialProperties (const SimTK::Vec3 &aScaleFactors, bool aScaleMass=true) |
Scale the body's mass and inertia tensor. | |
virtual void | scaleMass (double aScaleFactor) |
Scale the body's mass and inertia tensor (represents a scaling of the body's density). | |
virtual const VisibleObject * | getDisplayer () const |
virtual VisibleObject * | updDisplayer () |
virtual const int | getIndex () const |
void | getScaleFactors (SimTK::Vec3 &aScaleFactors) const |
WrapObject * | getWrapObject (const std::string &aName) const |
WrapObjectSet & | getWrapObjectSet () |
OPENSIM_DECLARE_DERIVED (Body, Object) | |
SimTK::MassProperties | getMassProperties () |
Assemble body interial properties: mass, center of mass location, moment of inertia about the origin of the body and return as a SimTK::MassProperties. | |
Protected Attributes | |
PropertyDbl | _massProp |
Mass of the body. | |
double & | _mass |
PropertyDblVec3 | _massCenterProp |
Mass center of body. | |
SimTK::Vec3 & | _massCenter |
PropertyDbl | _inertiaXXProp |
Moment of inertia Ixx computed with respect to the body's center of mass. | |
double & | _inertiaXX |
PropertyDbl | _inertiaYYProp |
Moment of inertia Iyy computed with respect to the body's center of mass. | |
double & | _inertiaYY |
PropertyDbl | _inertiaZZProp |
Moment of inertia Izz computed with respect to the body's center of mass. | |
double & | _inertiaZZ |
PropertyDbl | _inertiaXYProp |
Product of inertia Ixy computed with respect to the body's center of mass. | |
double & | _inertiaXY |
PropertyDbl | _inertiaXZProp |
Product of inertia Ixz computed with respect to the body's center of mass. | |
double & | _inertiaXZ |
PropertyDbl | _inertiaYZProp |
Product of inertia Iyz computed with respect to the body's center of mass. | |
double & | _inertiaYZ |
PropertyObjPtr< Joint > | _jointProp |
Joint connecting this body with the parent body. | |
Joint *& | _joint |
PropertyObj | _displayerProp |
For display of the body. | |
VisibleObject & | _displayer |
PropertyObj | _wrapObjectSetProp |
Set containing the wrap objects attached to this body. | |
WrapObjectSet & | _wrapObjectSet |
SimTK::MobilizedBodyIndex | _index |
ID for the body in Simbody. | |
Friends | |
class | Model |
class | SimbodyEngine |
class | Joint |
class | WeldConstraint |
A class implementing a Simbody body segment.
Body::~Body | ( | ) | [virtual] |
Destructor.
Body::Body | ( | ) |
Default constructor.
Body::Body | ( | const std::string & | aName, | |
double | aMass, | |||
const SimTK::Vec3 & | aMassCenter, | |||
const SimTK::Inertia & | aInertia | |||
) |
Constructor.
void Body::addDisplayGeometry | ( | const std::string & | aGeometryFileName | ) | [virtual] |
Add display geometry to body.
aGeometryFileName | Geometry filename. |
Object * Body::copy | ( | ) | const [virtual] |
Copy constructor from an AbstractBody.
aBody | Body to be copied. |
Body::Body(const AbstractBody &aBody) : AbstractBody(aBody), _mass(_massProp.getValueDbl()), _massCenter(_massCenterProp.getValueDblVec3()), _inertiaXX(_inertiaXXProp.getValueDbl()), _inertiaYY(_inertiaYYProp.getValueDbl()), _inertiaZZ(_inertiaZZProp.getValueDbl()), _inertiaXY(_inertiaXYProp.getValueDbl()), _inertiaXZ(_inertiaXZProp.getValueDbl()), _inertiaYZ(_inertiaYZProp.getValueDbl()), _joint(_jointProp.getValueObjPtrRef()), _displayerProp(PropertyObj("", VisibleObject())), _displayer((VisibleObject&)_displayerProp.getValueObj()) { setNull(); setupProperties(); copyData(aBody); }
_____________________________________________________________________________ /** Copy this body and return a pointer to the copy. The copy constructor for this class is used.
Reimplemented from OpenSim::Object.
void Body::copyData | ( | const Body & | aBody | ) |
virtual const VisibleObject* OpenSim::Body::getDisplayer | ( | ) | const [inline, virtual] |
Reimplemented from OpenSim::Object.
const int Body::getIndex | ( | ) | const [virtual] |
void Body::getInertia | ( | SimTK::Mat33 & | rInertia | ) | const [virtual] |
Get the inertia matrix of the body.
3x3 | inertia matrix. |
Joint & Body::getJoint | ( | ) | const [virtual] |
double Body::getMass | ( | ) | const [virtual] |
Get the mass of the body.
void Body::getMassCenter | ( | SimTK::Vec3 & | rVec | ) | const [virtual] |
Get the mass center of the body.
rVec | XYZ coordinates of mass center are returned here. |
SimTK::MassProperties Body::getMassProperties | ( | ) |
Assemble body interial properties: mass, center of mass location, moment of inertia about the origin of the body and return as a SimTK::MassProperties.
void Body::getScaleFactors | ( | SimTK::Vec3 & | aScaleFactors | ) | const |
WrapObject* OpenSim::Body::getWrapObject | ( | const std::string & | aName | ) | const |
WrapObjectSet& OpenSim::Body::getWrapObjectSet | ( | ) | [inline] |
virtual bool OpenSim::Body::hasJoint | ( | ) | const [inline, virtual] |
void Body::scale | ( | const SimTK::Vec3 & | aScaleFactors, | |
bool | aScaleMass = false | |||
) | [virtual] |
Scale the body.
aScaleFactors | XYZ scale factors. | |
aScaleMass | whether or not to scale mass properties |
void Body::scaleInertialProperties | ( | const SimTK::Vec3 & | aScaleFactors, | |
bool | aScaleMass = true | |||
) | [virtual] |
Scale the body's mass and inertia tensor.
aScaleFactors | XYZ scale factors. | |
aScaleMass | Whether or not to scale the mass |
void Body::scaleMass | ( | double | aScaleFactor | ) | [virtual] |
Scale the body's mass and inertia tensor (represents a scaling of the body's density).
aScaleFactors | XYZ scale factors. |
bool Body::setInertia | ( | const SimTK::Inertia & | aInertia | ) | [virtual] |
Set the inertia matrix of the body.
aInertia | 9-element inertia matrix. |
void Body::setJoint | ( | Joint & | aJoint | ) | [virtual] |
bool Body::setMass | ( | double | aMass | ) | [virtual] |
Set the mass of the body.
aMass | mass of body. |
bool Body::setMassCenter | ( | const SimTK::Vec3 & | aVec | ) | [virtual] |
Set the mass center of the body.
aVec | XYZ coordinates of mass center. |
void Body::setup | ( | Model & | aModel | ) | [virtual] |
Perform some set up functions that happen after the object has been deserialized or copied.
aModel | OpenSim model containing this Body. |
virtual VisibleObject* OpenSim::Body::updDisplayer | ( | ) | [inline, virtual] |
Reimplemented from OpenSim::Object.
friend class Joint [friend] |
friend class Model [friend] |
friend class SimbodyEngine [friend] |
friend class WeldConstraint [friend] |
VisibleObject& OpenSim::Body::_displayer [protected] |
PropertyObj OpenSim::Body::_displayerProp [protected] |
For display of the body.
SimTK::MobilizedBodyIndex OpenSim::Body::_index [protected] |
ID for the body in Simbody.
double& OpenSim::Body::_inertiaXX [protected] |
PropertyDbl OpenSim::Body::_inertiaXXProp [protected] |
Moment of inertia Ixx computed with respect to the body's center of mass.
double& OpenSim::Body::_inertiaXY [protected] |
PropertyDbl OpenSim::Body::_inertiaXYProp [protected] |
Product of inertia Ixy computed with respect to the body's center of mass.
double& OpenSim::Body::_inertiaXZ [protected] |
PropertyDbl OpenSim::Body::_inertiaXZProp [protected] |
Product of inertia Ixz computed with respect to the body's center of mass.
double& OpenSim::Body::_inertiaYY [protected] |
PropertyDbl OpenSim::Body::_inertiaYYProp [protected] |
Moment of inertia Iyy computed with respect to the body's center of mass.
double& OpenSim::Body::_inertiaYZ [protected] |
PropertyDbl OpenSim::Body::_inertiaYZProp [protected] |
Product of inertia Iyz computed with respect to the body's center of mass.
double& OpenSim::Body::_inertiaZZ [protected] |
PropertyDbl OpenSim::Body::_inertiaZZProp [protected] |
Moment of inertia Izz computed with respect to the body's center of mass.
Joint* & OpenSim::Body::_joint [protected] |
PropertyObjPtr<Joint> OpenSim::Body::_jointProp [protected] |
Joint connecting this body with the parent body.
double& OpenSim::Body::_mass [protected] |
SimTK::Vec3& OpenSim::Body::_massCenter [protected] |
PropertyDblVec3 OpenSim::Body::_massCenterProp [protected] |
Mass center of body.
PropertyDbl OpenSim::Body::_massProp [protected] |
Mass of the body.
WrapObjectSet& OpenSim::Body::_wrapObjectSet [protected] |
PropertyObj OpenSim::Body::_wrapObjectSetProp [protected] |
Set containing the wrap objects attached to this body.