- dynoContactor(void)
- constructor
- ~dynoContactor(void)
- destructor
- ptrList contacts
- the list of current contacts
- objHash* linkToContact
- link-to-contact-list mapping
- dynoCollisionDetector* cd
- the dynoCollisionDetector used for initially detecting contact
- int checkViolations
- indicates whether violation checking should be done. This defaults
to 1 and normally does not need to be changed by users.
- double tol
- the inter-penetration tolerance used for contacts. Values in the
1mm-1cm range are best, and the default is 0.005 (5mm). Smaller
values may slow simulation, while larger values allow more
penetration between objects.
- enum contactType
- The different types of contacts in the system.
- OBSTACLE - the object is an obstacle.
- USER - a user-specified callback should be called when
contacts are detected for the specified object.
- FRICTIONLESS - the object is a link and contacts should be
modeled as frictionless point contacts.
- POINT - the object is a link and contacts should be modeled
as point contacts with static and dynamic friction
- CYLINDER - the object is a link and contacts should be
modeled as rolling contacts. Wheel-specific contact patch
calculations are used for CYLINDER contacts.
- SPHERE - the object is a sphere and contacts should be
modeled as rolling contacts.
- COMPLIANT - (not currently supported)
- DETECT_ONLY - Prints a message when collisions are detected and
the verbose level is SO_INFO or higher, and calls a user-defined
callback if one was supplied.
- cdRecord* addLink(link* l, contactType type, double muS, double muD, int flags = DYNO_COMPUTE_OBSTACLE_CONTACTS, ptrList* whichParts = NULL, userContactCB* cb = NULL, void* userData = NULL)
- adds l to the contactor. contactType indicates the type
of contact to be created for the object. muS and muD are the
object's static and dynamic coefficients of friction. If whichParts
is non-NULL, then any mpolys that do not belong to a part
in whichParts will be ignored.
'flags' indicates what collision/contact operations are desired; see
dynoCollisionOperation for definitions of the values that can be
bitwise or'd for 'flags'.
Returns the cdRecord created for
the link, in case the caller wishes to change any of its values, or
NULL if there's an error.
- cdRecord* addRollingLink(link* l, contactType type, double muS, double muD, dynoWheelInfo* winfo, int flags = DYNO_COMPUTE_OBSTACLE_CONTACTS, ptrList* whichParts = NULL)
- adds l to the contactor. contactType must be either SPHERE
or CYLINDER. muS and muD are the object's static
and dynamic coefficients of friction, and wheel-specific geometry
information is supplied in 'winfo'. If whichParts
is non-NULL, then any mpolys that do not belong to a part
in whichParts will be ignored.
'flags' indicates what collision/contact operations are desired; see
dynoCollisionOperation for definitions of the values that can be
bitwise or'd for 'flags'.
Returns the cdRecord created for
the link, in case the caller wishes to change any of its values, or
NULL if there's an error.
- cdRecord* addFixedObject(mpoly* p, double muS, double muD)
- adds a fixed object with the specified friction coefficients to the
contactor. Returns the cdRecord created for the object, or NULL if
there's an error.
- int addMechanism(mechanism* m, contactType type, double muS, double muD, int flags = DYNO_COMPUTE_OBSTACLE_CONTACTS, userContactCB* cb = NULL, void* userData = NULL)
- adds m's links to the contactor. type, muS and muD will be used for
all links in the object. If more specific control over friction
coefficients, contact types, and collision/contact computations is
desired, addLink() and addRollingLink() can be used instead.
'flags' indicates what collision/contact operations are desired; see
dynoCollisionOperation for definitions of the values that can be
bitwise or'd for 'flags'.
If cb is non-NULL, then it will be called
when any contacts are detected
- int removeLink(link* l)
- removes l from the contactor and frees any associated memory
- int removeObject(mpoly* p)
- removes p from the contactor and frees any associated memory
allocated by the dynoContactor. Does not delete p
- int removeObject(cdRecord* rec)
- removes the indicated object from the contactor and frees any
associated memory, including rec. Note: this should only be used
for objects, not links. Does not delete the mpoly representing
the object's shape.
- inline int numContacts(void) const
- returns the number of contacts
- inline dynoContact* getContact(int i)
- returns the i'th contact
- inline int numRecords(void) const
- returns the number of cdRecords
- inline cdRecord* getRecord(int i)
- returns the ith cdRecord
- int checkCollisions(int onlyFirst = 1)
- checks objects for collisions, but doesn't compute contacts
- int reset(void)
- Resets state; deletes contacts