In file /home/blah/darwin2k/src/dyno/mechanism/dynoCollision.h:

class dynoContactor

Detects collisions between objects and adds contact constraints and/or influences to the dynamicSystem so that contact can be simulated.

Inheritance:


Public Fields

[more]ptrList contacts
the list of current contacts
[more]objHash* linkToContact
link-to-contact-list mapping
[more]dynoCollisionDetector* cd
the dynoCollisionDetector used for initially detecting contact
[more]int checkViolations
indicates whether violation checking should be done.
[more]double tol
the inter-penetration tolerance used for contacts.

Public Methods

[more] dynoContactor(void)
constructor
[more] ~dynoContactor(void)
destructor
[more]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.
[more]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.
[more]cdRecord* addFixedObject(mpoly* p, double muS, double muD)
adds a fixed object with the specified friction coefficients to the contactor.
[more]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.
[more]int removeLink(link* l)
removes l from the contactor and frees any associated memory
[more]int removeObject(mpoly* p)
removes p from the contactor and frees any associated memory allocated by the dynoContactor.
[more]int removeObject(cdRecord* rec)
removes the indicated object from the contactor and frees any associated memory, including rec.
[more]inline int numContacts(void) const
returns the number of contacts
[more]inline dynoContact* getContact(int i)
returns the i'th contact
[more]inline int numRecords(void) const
returns the number of cdRecords
[more]inline cdRecord* getRecord(int i)
returns the ith cdRecord
[more]int checkCollisions(int onlyFirst = 1)
checks objects for collisions, but doesn't compute contacts
[more]int reset(void)
Resets state; deletes contacts

Public Members

[more]enum contactType
The different types of contacts in the system.


Inherited from dynoComponent:

Public Fields

oint applyAfterAccel

Public Methods

ovirtual int update(int &violated, int shortCircuit)


Inherited from dynoObject:

Public Fields

odynamicSystem* ds
oint active
oint stateSize

Public Methods

oinline virtual int getState(double* state)
oinline virtual int setState(const double* state)


Inherited from synObject:

Public Fields

ostatic int staticClassID
oint objectID
oint verboseLevel

Public Methods

ovirtual const char* className(void) const
ovirtual synObject* copy(void) const
ovirtual int isOfType(int typeNum, int derivedOk)
ostatic int setStaticClassID(void)
ovirtual int classID(void) const


Documentation

Detects collisions between objects and adds contact constraints and/or influences to the dynamicSystem so that contact can be simulated. Several types of contacts are available; see the enumerated type contactType for definitions. Currently, the static and dynamic friction coefficients for a contact are computed as the product of the coefficients for the two objects in contact. This may change in the future to use enumerated material types and a lookup table for friction coefficients versus pairs of materials.
o dynoContactor(void)
constructor

o ~dynoContactor(void)
destructor

optrList contacts
the list of current contacts

oobjHash* linkToContact
link-to-contact-list mapping

odynoCollisionDetector* cd
the dynoCollisionDetector used for initially detecting contact

oint checkViolations
indicates whether violation checking should be done. This defaults to 1 and normally does not need to be changed by users.

odouble 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.

oenum contactType
The different types of contacts in the system.

ocdRecord* 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.

ocdRecord* 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.

ocdRecord* 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.

oint 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

oint removeLink(link* l)
removes l from the contactor and frees any associated memory

oint removeObject(mpoly* p)
removes p from the contactor and frees any associated memory allocated by the dynoContactor. Does not delete p

oint 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.

oinline int numContacts(void) const
returns the number of contacts

oinline dynoContact* getContact(int i)
returns the i'th contact

oinline int numRecords(void) const
returns the number of cdRecords

oinline cdRecord* getRecord(int i)
returns the ith cdRecord

oint checkCollisions(int onlyFirst = 1)
checks objects for collisions, but doesn't compute contacts

oint reset(void)
Resets state; deletes contacts


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.