Simbody
|
A ContactTracker implements an algorithm for detecting overlaps or potential overlaps between pairs of ContactGeometry objects, and managing Contact objects that track individual contacts as they evolve through time. More...
#include <ContactTrackerSubsystem.h>
Classes | |
class | HalfSpaceEllipsoid |
This ContactTracker handles contacts between a ContactGeometry::HalfSpace and a ContactGeometry::Ellipsoid, in that order. More... | |
class | HalfSpaceSphere |
This ContactTracker handles contacts between a ContactGeometry::HalfSpace and a ContactGeometry::Sphere, in that order. More... | |
class | HalfSpaceTriangleMesh |
This ContactTracker handles contacts between a ContactGeometry::HalfSpace and a ContactGeometry::TriangleMesh, in that order. More... | |
class | SphereSphere |
This ContactTracker handles contacts between two ContactGeometry::Sphere objects. More... | |
class | SphereTriangleMesh |
This ContactTracker handles contacts between a ContactGeometry::Sphere and a ContactGeometry::TriangleMesh, in that order. More... | |
class | TriangleMeshTriangleMesh |
This ContactTracker handles contacts between two ContactGeometry::TriangleMesh surfaces. More... | |
Public Member Functions | |
ContactTracker (ContactGeometryTypeId typeOfSurface1, ContactGeometryTypeId typeOfSurface2) | |
Base class constructor for use by the concrete classes. | |
const std::pair < ContactGeometryTypeId, ContactGeometryTypeId > & | getContactGeometryTypeIds () const |
Return the pair of contact geometry type ids handled by this tracker, in the order that they must be presented to the tracker's methods. | |
virtual | ~ContactTracker () |
virtual bool | trackContact (const Contact &priorStatus, const Transform &X_GS1, const ContactGeometry &surface1, const Transform &X_GS2, const ContactGeometry &surface2, Real cutoff, Contact ¤tStatus) const =0 |
The ContactTrackerSubsystem will invoke this method for any pair of contact surfaces that is already being tracked, or for which the static broad phase analysis indicated that they might be in contact now. | |
virtual bool | predictContact (const Contact &priorStatus, const Transform &X_GS1, const SpatialVec &V_GS1, const SpatialVec &A_GS1, const ContactGeometry &surface1, const Transform &X_GS2, const SpatialVec &V_GS2, const SpatialVec &A_GS2, const ContactGeometry &surface2, Real cutoff, Real intervalOfInterest, Contact &predictedStatus) const =0 |
The ContactTrackerSubsystem will invoke this method for any tracked pair of contact surfaces that is still not in contact after trackContact() looked at it, or any untracked pair for which the dynamic broad phase indicated that they might be in contact within the interval of interest. | |
virtual bool | initializeContact (const Transform &X_GS1, const SpatialVec &V_GS1, const ContactGeometry &surface1, const Transform &X_GS2, const SpatialVec &V_GS2, const ContactGeometry &surface2, Real cutoff, Real intervalOfInterest, Contact &contactStatus) const =0 |
At the beginning of a simulation we will have no past information to help disambiguate tricky contact situations. |
A ContactTracker implements an algorithm for detecting overlaps or potential overlaps between pairs of ContactGeometry objects, and managing Contact objects that track individual contacts as they evolve through time.
This class is used internally by ContractTrackerSubsystem and there usually is no reason to access it directly. The exception is if you are defining a new ContactGeometry subclass. In that case, you will also need to define one or more ContactTrackers to detect collisions with your new geometry type, then register it with the ContactTrackerSubsystem.
Note that ContactTrackers that manage dissimilar geometry type pairs expect the two types in a particular order, e.g. (halfspace,sphere) rather than (sphere,halfspace) but are used for all contacts involving that pair of types. It is up to the ContactTrackerSubsystem to ensure that the contact surfaces are presented in the correct order regardless of how they are encountered. The Contact objects that are created and managed by trackers always have their (surface1,surface2) pairs in the order required by the tracker that handles those types.
SimTK::ContactTracker::ContactTracker | ( | ContactGeometryTypeId | typeOfSurface1, |
ContactGeometryTypeId | typeOfSurface2 | ||
) | [inline] |
Base class constructor for use by the concrete classes.
virtual SimTK::ContactTracker::~ContactTracker | ( | ) | [inline, virtual] |
const std::pair<ContactGeometryTypeId,ContactGeometryTypeId>& SimTK::ContactTracker::getContactGeometryTypeIds | ( | ) | const [inline] |
Return the pair of contact geometry type ids handled by this tracker, in the order that they must be presented to the tracker's methods.
virtual bool SimTK::ContactTracker::trackContact | ( | const Contact & | priorStatus, |
const Transform & | X_GS1, | ||
const ContactGeometry & | surface1, | ||
const Transform & | X_GS2, | ||
const ContactGeometry & | surface2, | ||
Real | cutoff, | ||
Contact & | currentStatus | ||
) | const [pure virtual] |
The ContactTrackerSubsystem will invoke this method for any pair of contact surfaces that is already being tracked, or for which the static broad phase analysis indicated that they might be in contact now.
Only position information is available. Note that the arguments and Contact object surfaces must be ordered by geometry type id as required by this tracker.
Implemented in SimTK::ContactTracker::HalfSpaceSphere, SimTK::ContactTracker::HalfSpaceEllipsoid, SimTK::ContactTracker::SphereSphere, SimTK::ContactTracker::HalfSpaceTriangleMesh, SimTK::ContactTracker::SphereTriangleMesh, and SimTK::ContactTracker::TriangleMeshTriangleMesh.
virtual bool SimTK::ContactTracker::predictContact | ( | const Contact & | priorStatus, |
const Transform & | X_GS1, | ||
const SpatialVec & | V_GS1, | ||
const SpatialVec & | A_GS1, | ||
const ContactGeometry & | surface1, | ||
const Transform & | X_GS2, | ||
const SpatialVec & | V_GS2, | ||
const SpatialVec & | A_GS2, | ||
const ContactGeometry & | surface2, | ||
Real | cutoff, | ||
Real | intervalOfInterest, | ||
Contact & | predictedStatus | ||
) | const [pure virtual] |
The ContactTrackerSubsystem will invoke this method for any tracked pair of contact surfaces that is still not in contact after trackContact() looked at it, or any untracked pair for which the dynamic broad phase indicated that they might be in contact within the interval of interest.
Position, velocity, and acceleration information may be used. Ordering must be correct as discussed for trackContact().
Implemented in SimTK::ContactTracker::HalfSpaceSphere, SimTK::ContactTracker::HalfSpaceEllipsoid, SimTK::ContactTracker::SphereSphere, SimTK::ContactTracker::HalfSpaceTriangleMesh, SimTK::ContactTracker::SphereTriangleMesh, and SimTK::ContactTracker::TriangleMeshTriangleMesh.
virtual bool SimTK::ContactTracker::initializeContact | ( | const Transform & | X_GS1, |
const SpatialVec & | V_GS1, | ||
const ContactGeometry & | surface1, | ||
const Transform & | X_GS2, | ||
const SpatialVec & | V_GS2, | ||
const ContactGeometry & | surface2, | ||
Real | cutoff, | ||
Real | intervalOfInterest, | ||
Contact & | contactStatus | ||
) | const [pure virtual] |
At the beginning of a simulation we will have no past information to help disambiguate tricky contact situations.
This method may use current position and velocity information in heuristics for guessing the contact status between the indicated pair of surfaces. Ordering must be correct as discussed for trackContact().
Implemented in SimTK::ContactTracker::HalfSpaceSphere, SimTK::ContactTracker::HalfSpaceEllipsoid, SimTK::ContactTracker::SphereSphere, SimTK::ContactTracker::HalfSpaceTriangleMesh, SimTK::ContactTracker::SphereTriangleMesh, and SimTK::ContactTracker::TriangleMeshTriangleMesh.