Simbody
Public Member Functions | Static Public Member Functions

SimTK::TriangleMeshContact Class Reference

This subclass of Contact is used when one or both of the ContactGeometry objects is a TriangleMesh. More...

#include <Contact.h>

Inheritance diagram for SimTK::TriangleMeshContact:

List of all members.

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.
const std::set< int > & getSurface1Faces () const
 Get the indices of all faces of surface1 that are partly or completely inside surface2.
const std::set< int > & getSurface2Faces () const
 Get the indices of all faces of surface2 that are partly or completely inside surface1.

Static Public Member Functions

static bool isInstance (const Contact &contact)
 Determine whether a Contact object is a TriangleMeshContact.
static const TriangleMeshContactgetAs (const Contact &contact)
 Recast a triangle mesh given as a generic Contact object to a const reference to a concrete TriangleMeshContact object.
static TriangleMeshContactupdAs (Contact &contact)
 Recast a triangle mesh given as a generic Contact object to a writable reference to a concrete TriangleMeshContact object.
static ContactTypeId classTypeId ()
 Obtain the unique small-integer id for the TriangleMeshContact class.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
surf1the index of the first surface involved in the contact, specified by its index within its contact set
surf2the index of the second surface involved in the contact, specified by its index within its contact set
X_S1S2the transform giving surf2's frame measured and expressed in surf1's frame
faces1the indices of all faces in the first surface which are inside the second one
faces2the indices of all faces in the second surface which are inside the first one

Member Function Documentation

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 bool SimTK::TriangleMeshContact::isInstance ( const Contact contact) [static]

Determine whether a Contact object is a TriangleMeshContact.

static const TriangleMeshContact& SimTK::TriangleMeshContact::getAs ( const Contact contact) [inline, static]

Recast a triangle mesh given as a generic Contact object to a const reference to a concrete TriangleMeshContact object.

static TriangleMeshContact& SimTK::TriangleMeshContact::updAs ( Contact contact) [inline, static]

Recast a triangle mesh given as a generic Contact object to a writable reference to a concrete TriangleMeshContact object.

static ContactTypeId SimTK::TriangleMeshContact::classTypeId ( ) [static]

Obtain the unique small-integer id for the TriangleMeshContact class.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines