#include <ContactCatcher.hh>
The ContactCatcher class deals with the detection, establishment and termination of special types of contacts between selected pairs of surfaces. An instance of this object must be registered with the Arachi engine, which in turns calls the virtual method handle() each time a collision is detected. The handle method then goes through an internal database of surface pairs and generates the appropriate type of contact through a ContactFactory object as indicated through prior add() method calls.
Public Member Functions | |
| void | handle (void) |
| void | update (DeTimeEvent *event) |
| void | add (Object *a, Object *b, ContactFactory *t) |
| void | add (Surface *a, Surface *b, ContactFactory *t) |
| void | clear () |
| Contact * | findContact (Object *a, Object *b) |
| void | printSurfacePairs (void) |
| void | printObjectPairs (void) |
|
||||||||||||||||
|
This method can be used to associate a special contact type with a pair of surfaces. The ContactCatcher class maintains an internal database of such associations which is then used by the handle() method to detect special collisions. Note that order of the pointers to the Surface objects is important. The establish() method of the corresponding Contact object will be called with the objects in this order. Unfortunately, if both objects have the same surface type, this order will be unspecified as there is no way of telling them apart. |
|
||||||||||||||||
|
This method can be used to associate a special contact type with a pair of objects. The ContactCatcher class maintains an internal database of such associations which is then used by the handle() method to detect special collisions. Note that object associations override surface type associations as they are more specific. Note that the order of the object pointers is important. The establish() method of the class Contact will be called with the order used in this function call. |
|
|
This method clears all previously registered object and surface pairs |
|
||||||||||||
|
This method searches previously established contacts for the specified pair. |
|
|
This method is called by the Arachi engine whenever a collision is detected. Its implementation identifies object pairs that require special contact handling and creates the appropriate contact object. |
|
|
This method will be periodically called by arachi with a frequency that is determined by CDL's integration step setting. It is intended to check termination conditions for established contacts, as well as any other periodic tasks that may be needed. |