Simbody
3.6
|
This subclass of Contact is used when one or both of the ContactGeometry objects is a TriangleMesh. More...
Public Member Functions | |
TriangleMeshContact (ContactSurfaceIndex surf1, ContactSurfaceIndex surf2, const Transform &X_S1S2, const std::set< int > &faces1, const std::set< int > &faces2) | |
Create a TriangleMeshContact object. More... | |
const std::set< int > & | getSurface1Faces () const |
Get the indices of all faces of surface1 that are partly or completely inside surface2. More... | |
const std::set< int > & | getSurface2Faces () const |
Get the indices of all faces of surface2 that are partly or completely inside surface1. More... | |
Public Member Functions inherited from SimTK::Contact | |
Contact () | |
The default constructor creates an empty handle. More... | |
Contact (const Contact &source) | |
Copy constructor is shallow and reference-counted; this handle will point to the same object as does the source. More... | |
~Contact () | |
Destructor clears the handle, deleting the referenced object if this was the last reference. More... | |
Contact & | operator= (const Contact &source) |
Copy assignment is shallow and reference-counted; this handle will point to the same object as does the source. More... | |
void | clear () |
Clear this handle, deleting the referenced object if this was the last reference. More... | |
bool | isEmpty () const |
See if this handle is empty. More... | |
ContactId | getContactId () const |
Get the persistent ContactId that has been assigned to this Contact object if there is one (otherwise this will be invalid – you can check with isValid(). More... | |
Condition | getCondition () const |
Find out the current condition of this Contact object. More... | |
ContactSurfaceIndex | getSurface1 () const |
Get the first surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem. More... | |
ContactSurfaceIndex | getSurface2 () const |
Get the second surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem. More... | |
const Transform & | getTransform () const |
Return the transform X_S1S2 giving the pose of surface 2's frame measured and expressed in surface 1's frame, recorded at the time this Contact object was calculated. More... | |
Contact & | setContactId (ContactId id) |
Set the ContactId for this Contact object. More... | |
Contact & | setCondition (Condition condition) |
Set the current Condition. More... | |
Contact & | setSurfaces (ContactSurfaceIndex surf1, ContactSurfaceIndex surf2) |
Set the surfaces tracked by this Contact object. More... | |
Contact & | setTransform (const Transform &X_S1S2) |
Set the surface-to-surface relative transform X_S1S2. More... | |
ContactTypeId | getTypeId () const |
Return a unique small integer corresponding to the concrete type of Contact object being referenced by this handle. More... | |
const ContactImpl & | getImpl () const |
ContactImpl & | updImpl () |
Static Public Member Functions | |
static bool | isInstance (const Contact &contact) |
Determine whether a Contact object is a TriangleMeshContact. More... | |
static const TriangleMeshContact & | getAs (const Contact &contact) |
Recast a triangle mesh given as a generic Contact object to a const reference to a concrete TriangleMeshContact object. More... | |
static TriangleMeshContact & | updAs (Contact &contact) |
Recast a triangle mesh given as a generic Contact object to a writable reference to a concrete TriangleMeshContact object. More... | |
static ContactTypeId | classTypeId () |
Obtain the unique small-integer id for the TriangleMeshContact class. More... | |
Static Public Member Functions inherited from SimTK::Contact | |
static const char * | nameOfCondition (Condition) |
Returns a human-readable name corresponding to the given Condition; useful for debugging. More... | |
static ContactId | createNewContactId () |
This creates a new ContactId starting from 1 and increasing for a very long time (to a billion or so) before repeating. More... | |
Additional Inherited Members | |
Public Types inherited from SimTK::Contact | |
enum | Condition { Unknown, Untracked, Anticipated, NewContact, Ongoing, Broken } |
The Contact::Condition tracks the status of a Contact through its lifetime. More... | |
Protected Member Functions inherited from SimTK::Contact | |
Contact (ContactImpl *impl) | |
This subclass of Contact is used when one or both of the ContactGeometry objects is a TriangleMesh.
It stores a list of every face on each object that is partly or completely inside the other one.
SimTK::TriangleMeshContact::TriangleMeshContact | ( | ContactSurfaceIndex | surf1, |
ContactSurfaceIndex | surf2, | ||
const Transform & | X_S1S2, | ||
const std::set< int > & | faces1, | ||
const std::set< int > & | faces2 | ||
) |
Create a TriangleMeshContact object.
surf1 | the index of the first surface involved in the contact, specified by its index within its contact set |
surf2 | the index of the second surface involved in the contact, specified by its index within its contact set |
X_S1S2 | the transform giving surf2's frame measured and expressed in surf1's frame |
faces1 | the indices of all faces in the first surface which are inside the second one |
faces2 | the indices of all faces in the second surface which are inside the first one |
const std::set<int>& SimTK::TriangleMeshContact::getSurface1Faces | ( | ) | const |
Get the indices of all faces of surface1 that are partly or completely inside surface2.
If surface1 is not a TriangleMesh, this will return an empty set.
const std::set<int>& SimTK::TriangleMeshContact::getSurface2Faces | ( | ) | const |
Get the indices of all faces of surface2 that are partly or completely inside surface1.
If surface2 is not a TriangleMesh, this will return an empty set.
|
static |
Determine whether a Contact object is a TriangleMeshContact.
|
inlinestatic |
Recast a triangle mesh given as a generic Contact object to a const reference to a concrete TriangleMeshContact object.
|
inlinestatic |
Recast a triangle mesh given as a generic Contact object to a writable reference to a concrete TriangleMeshContact object.
|
static |
Obtain the unique small-integer id for the TriangleMeshContact class.