Simbody
3.7
|
The Body class represents a reference frame that can be used to describe mass properties and geometry. More...
Classes | |
class | Ground |
This is a Body representing something immobile, of effectively infinite mass and inertia, that cannot be modified to be anything else. More... | |
class | Linear |
This is a rigid body in the shape of a line, which is inherently inertialess about its axis. More... | |
class | Massless |
This is a Body that is constitutively massless (and inertialess); meaning that no amount of fiddling with it will ever give it any mass or inertia. More... | |
class | Rigid |
A general rigid body. More... | |
Public Member Functions | |
Body () | |
Default constructor creates an empty Body handle. More... | |
~Body () | |
Destroy the handle and the body if this is the owner. More... | |
Body (const Body &source) | |
Copy constructor is a deep copy; the new Body is separate from the source Body. More... | |
Body & | operator= (const Body &source) |
Copy assignment is a deep copy; the original object is deleted if this is the owner, then replaced with a copy of the source. More... | |
Body (const MassProperties &massProps) | |
This is a default conversion from MassProperties to Body. More... | |
Body & | setDefaultRigidBodyMassProperties (const MassProperties &) |
Every type of Body should provide an initial set of rigid body mass properties defined at Topology stage (i.e., in the System rather than the State). More... | |
const MassProperties & | getDefaultRigidBodyMassProperties () const |
Get the default (that is, Topology stage) mass properties for this Body. More... | |
int | addDecoration (const Transform &X_BD, const DecorativeGeometry &geometry) |
Add a piece of decorative geometry fixed at some pose on this Body. More... | |
int | addDecoration (const DecorativeGeometry &geometry) |
Convenience method for when the decorative geometry is to be placed at the body frame. More... | |
int | getNumDecorations () const |
Obtain a count nd of how many pieces of DecorativeGeometry have been attached to this Body. More... | |
const DecorativeGeometry & | getDecoration (int i) const |
Get a read-only reference to the i'th piece of DecorativeGeometry that was added to this Body, with 0 <= i < getNumDecorations(). More... | |
DecorativeGeometry & | updDecoration (int i) const |
Get a writable reference to the i'th piece of DecorativeGeometry that was added to this Body, with 0 <= i < getNumDecorations(). More... | |
int | addContactSurface (const Transform &X_BS, const ContactSurface &shape) |
Create a new ContactSurface on a body and place it using the indicated Transform. More... | |
int | addContactSurface (const ContactSurface &shape) |
Convenience method for when the contact surface is to be placed at the body frame. More... | |
int | getNumContactSurfaces () const |
Obtain the number of contact surfaces ns attached to this Body. More... | |
const ContactSurface & | getContactSurface (int i) const |
Get a reference to the i'th contact surface on this body; be sure to get the Transform also. More... | |
const Transform & | getContactSurfaceTransform (int i) const |
Get the Transform specifying the placement of the i'th contact surface on this Body. More... | |
ContactSurface & | updContactSurface (int i) |
Get write access to the i'th unique contact surface owned by this Body. More... | |
Transform & | updContactSurfaceTransform (int i) |
Get a writable reference to the Transform specifying the placement of the i'th contact surface on this Body. More... | |
bool | isOwnerHandle () const |
bool | isEmptyHandle () const |
Body (class BodyRep *r) | |
bool | hasRep () const |
const BodyRep & | getRep () const |
BodyRep & | updRep () const |
void | setRep (BodyRep &r) |
Protected Attributes | |
class BodyRep * | rep |
The Body class represents a reference frame that can be used to describe mass properties and geometry.
These are in turn used to build MobilizedBodies which combine a body and a specified mobilizer that defines how the reference frame can move with respect to other MobilizedBodies. Attached geometric objects can serve as the basis for a variety of force-generating elements or other algorithms that act on bodies.
Body is an abstract base class handle, with concrete classes defined for each kind of body. There are a set of built-in body types, with Body::Rigid the most common.
|
inline |
Default constructor creates an empty Body handle.
SimTK::Body::~Body | ( | ) |
Destroy the handle and the body if this is the owner.
SimTK::Body::Body | ( | const Body & | source | ) |
SimTK::Body::Body | ( | const MassProperties & | massProps | ) |
This is a default conversion from MassProperties to Body.
It will result in a rigid body (concrete class Body::Rigid) being created using these as its default MassProperties. This is what allows you to provide MassProperties instead of a Body in the MobilizedBody constructors.
|
inlineexplicit |
Copy assignment is a deep copy; the original object is deleted if this is the owner, then replaced with a copy of the source.
Body& SimTK::Body::setDefaultRigidBodyMassProperties | ( | const MassProperties & | ) |
const MassProperties& SimTK::Body::getDefaultRigidBodyMassProperties | ( | ) | const |
int SimTK::Body::addDecoration | ( | const Transform & | X_BD, |
const DecorativeGeometry & | geometry | ||
) |
Add a piece of decorative geometry fixed at some pose on this Body.
This can be used for visualization of the Body's motion. Returns a small integer ordinal that can be used to identify this decoration in any copy of this Body. The supplied DecorativeGeometry object is copied and transformed by the given Transform so that the actual geometry is always stored relative to the body's frame. The copy's "index on body" is set to the same value as returned by this method.
|
inline |
Convenience method for when the decorative geometry is to be placed at the body frame.
This is the same as addDecoration(Transform(),geometry)
.
int SimTK::Body::getNumDecorations | ( | ) | const |
Obtain a count nd of how many pieces of DecorativeGeometry have been attached to this Body.
The ordinals i for individual decorations will be numbered 0 <= i < nd.
const DecorativeGeometry& SimTK::Body::getDecoration | ( | int | i | ) | const |
Get a read-only reference to the i'th piece of DecorativeGeometry that was added to this Body, with 0 <= i < getNumDecorations().
The ordinal i is the small integer that was returned by addDecoration().
DecorativeGeometry& SimTK::Body::updDecoration | ( | int | i | ) | const |
Get a writable reference to the i'th piece of DecorativeGeometry that was added to this Body, with 0 <= i < getNumDecorations().
The ordinal i is the small integer that was returned by addDecoration(). Note that we allow writable access to decorations even on a const Body – these are after all just decorations.
int SimTK::Body::addContactSurface | ( | const Transform & | X_BS, |
const ContactSurface & | shape | ||
) |
Create a new ContactSurface on a body and place it using the indicated Transform.
Unlike decorations, the Transform is kept separately rather than used to transform the copied surface in place. You can obtain it later with getContactSurfaceTransform(). A small integer ordinal is returned that can be used to identify this ContactSurface in any copy of this Body. That integer saved in the new ContactSurface object, using its setIndexOnBody() method.
|
inline |
Convenience method for when the contact surface is to be placed at the body frame.
This is the same as addContactSurface(Transform(),shape)
.
int SimTK::Body::getNumContactSurfaces | ( | ) | const |
Obtain the number of contact surfaces ns attached to this Body.
The valid body-local ordinals i will be 0 <= i < ns.
const ContactSurface& SimTK::Body::getContactSurface | ( | int | i | ) | const |
Get a reference to the i'th contact surface on this body; be sure to get the Transform also.
const Transform& SimTK::Body::getContactSurfaceTransform | ( | int | i | ) | const |
Get the Transform specifying the placement of the i'th contact surface on this Body.
ContactSurface& SimTK::Body::updContactSurface | ( | int | i | ) |
Transform& SimTK::Body::updContactSurfaceTransform | ( | int | i | ) |
bool SimTK::Body::isOwnerHandle | ( | ) | const |
bool SimTK::Body::isEmptyHandle | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |