#include <MBody.h>
Inherits MTransformable.
Collaboration diagram for MBody:

Public Member Functions | |
| MBody (const string &objectName, const dWorldID &worldID) | |
| virtual | ~MBody () |
| bool | initFromXML (const wxXmlNode &node) |
| void | getAvailableData (map< TLMDataIF::Key, TLMDataIF::DataInfo > &data) const |
| bool | getDataValue (const TLMDataIF::Key &key, string &data) const |
| bool | setDataValue (const TLMDataIF::Key &key, const string &data) |
| virtual void | setMassDistribution (const dMass &massDistribution) |
| virtual void | addMassDistribution (const dMass &massDistribution) |
| virtual void | addMassDistribution (const MGeometry &geom, const double mass) |
| virtual void | setTotalMass (const double mass) |
| virtual void | getTotalMass (double &mass) const |
| virtual void | getMassDistribution (double &m00, double &m01, double &m02, double &m11, double &m12, double &m22) const |
| virtual void | setMassDistribution (const double m00, const double m01, const double m02, const double m11, const double m12, const double m22) |
| virtual void | getCenterOfMass (double &x, double &y, double &z) const |
| virtual void | setCenterOfMass (const double x, const double y, const double z) |
| virtual void | setPosition (const double x, const double y, const double z) |
| virtual void | getPosition (double &x, double &y, double &z) const |
| virtual void | setVelocity (const double vx, const double vy, const double vz) |
| virtual void | getVelocity (double &vx, double &vy, double &vz) const |
| virtual void | getQuaternion (double &angle, double &x, double &y, double &z) const |
| virtual void | setQuaternion (const double angle, const double x, const double y, const double z) |
| virtual void | setRotation (const double phi, const double theta, const double psi) |
| const string & | objectName () const |
| void | objectName (const string &name) |
| dBodyID | bodyID () const |
Static Public Member Functions | |
| static MBody * | getBodyForID (const dBodyID id) |
Protected Member Functions | |
| void | cleanup () |
| bool | parseMassNode (const wxXmlNode &node, dMass &result) |
| Handle the <mass> XML node. | |
Protected Attributes | |
| string | myObjectName |
| The name of my parent object. | |
| dBodyID | myBodyID |
| The body id of this object in the physics model. | |
Definition at line 21 of file MBody.h.
|
||||||||||||
|
Create a new model object. This object will be added to the given world. This object doesn't have a shape or a mass until you call the set functions Definition at line 16 of file MBody.cpp. References memTraceMsg, and myBodyID. |
|
|
Definition at line 27 of file MBody.cpp. References cleanup(), and memTraceMsg. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Add a mass distribution to this body. This can be called multiple times to build up a mass distribution from a set of simple distributions. The geometry provides the distribution that matches its shape. Definition at line 420 of file MBody.cpp. References addMassDistribution(), MGeometry::getMassDistro(), and traceId. Here is the call graph for this function: ![]() |
|
|
Add a mass distribution to this body. This can be called multiple times to build up a mass distribution from a set of simple distributions Definition at line 411 of file MBody.cpp. References myBodyID, and traceId. Referenced by addMassDistribution(). |
|
|
Definition at line 178 of file MBody.h. References myBodyID. Referenced by MHingeJoint::MHingeJoint(). |
|
|
Definition at line 561 of file MBody.cpp. References myBodyID, and traceId. Referenced by ~MBody(). |
|
|
Get all the available data/telemetry elements that this class can provide. Each of the returned keys can be passed to the get/set functions to get/set that member data. Reimplemented from MTransformable. Definition at line 241 of file MBody.cpp. References TLMDataIF::DOUBLE, MTransformable::getAvailableData(), and traceId. Here is the call graph for this function: ![]() |
|
|
Get the MBody for a particular physics model body ID. Definition at line 10 of file MBody.cpp. References traceId. |
|
||||||||||||||||
|
Get the center of mass Definition at line 475 of file MBody.cpp. References myBodyID, and traceId. Referenced by getDataValue(), and setDataValue(). |
|
||||||||||||
|
Get the value of a particular data/telemetry element.
Reimplemented from MTransformable. Definition at line 274 of file MBody.cpp. References getCenterOfMass(), MTransformable::getDataValue(), getMassDistribution(), getTotalMass(), getVelocity(), and traceId. Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||||||
|
Get the mass distribution of the body The inertia matrix is defined as ( m00, m01, m02 ) ( m10, m11, m12 ) ( m20, m21, m22 ) However, you only specify the upper right and diagonal portion of the matrix since it is symetric Definition at line 446 of file MBody.cpp. References myBodyID, and traceId. Referenced by getDataValue(), and setDataValue(). |
|
||||||||||||||||
|
Get the position of the center of mass of the body. Implements MTransformable. |
|
||||||||||||||||||||
|
Get the quaternion. A quaternion is a vector and a rotation about that vector.
Implements MTransformable. |
|
|
Get the total mass of the body Definition at line 438 of file MBody.cpp. References myBodyID, and traceId. Referenced by getDataValue(). |
|
||||||||||||||||
|
Get the velocity of the body Definition at line 517 of file MBody.cpp. References myBodyID, and traceId. Referenced by getDataValue(), and setDataValue(). |
|
|
Initialize this body from the <body> XML node. This will setup the mass distribution of the body. Definition at line 33 of file MBody.cpp. References myBodyID, myObjectName, parseMassNode(), traceId, and verboseMsg. Here is the call graph for this function: ![]() |
|
|
Definition at line 176 of file MBody.h. References myObjectName. |
|
|
Definition at line 175 of file MBody.h. References myObjectName. Referenced by MJoint::getDataValue(). |
|
||||||||||||
|
Handle the <mass> XML node.
Definition at line 64 of file MBody.cpp. References myObjectName, traceId, and verboseMsg. Referenced by initFromXML(). |
|
||||||||||||||||
|
Set the center of mass Definition at line 485 of file MBody.cpp. References myBodyID, and traceId. Referenced by setDataValue(). |
|
||||||||||||
|
Set the value of a particular data/telemetry element.
Reimplemented from MTransformable. Definition at line 341 of file MBody.cpp. References getCenterOfMass(), getMassDistribution(), getVelocity(), setCenterOfMass(), MTransformable::setDataValue(), setMassDistribution(), setTotalMass(), setVelocity(), and traceId. Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||||||
|
|
|
|
Setup the mass distribution for this object. If this function isn't called, the object defaults to a mass zero particle Definition at line 405 of file MBody.cpp. References myBodyID, and traceId. Referenced by setDataValue(), and setTotalMass(). |
|
||||||||||||||||
|
Set the position of the body. This will set the positions of the associcated geometries too. Be careful when using this on a body currently being simulated. This can mess up joints. Certainly don't call this every frame to move an object. Instead provide forces and let the physics engine move the objects. Implements MTransformable. |
|
||||||||||||||||||||
|
Get the quaternion. A quaternion is a vector and a rotation about that vector.
Implements MTransformable. |
|
||||||||||||||||
|
Set the rotation rotation. These are euler angles.
Implements MTransformable. |
|
|
Adjust the mass disribution of this object so that the total mass is the given mass Definition at line 429 of file MBody.cpp. References myBodyID, setMassDistribution(), and traceId. Referenced by setDataValue(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Set the velocity of the body. Be careful when using this on a body currently being simulated. This can mess up joints. Certainly don't call this every frame to move an object. Instead provide forces and let the physics engine move the objects. Definition at line 526 of file MBody.cpp. References myBodyID, and traceId. Referenced by setDataValue(). |
|
|
The body id of this object in the physics model.
Definition at line 188 of file MBody.h. Referenced by addMassDistribution(), bodyID(), cleanup(), getCenterOfMass(), getMassDistribution(), getPosition(), getQuaternion(), getTotalMass(), getVelocity(), initFromXML(), MBody(), setCenterOfMass(), setMassDistribution(), setPosition(), setQuaternion(), setRotation(), setTotalMass(), and setVelocity(). |
|
|
The name of my parent object.
Definition at line 186 of file MBody.h. Referenced by initFromXML(), objectName(), and parseMassNode(). |
1.4.5