Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ContactCatcher Class Reference

#include <ContactCatcher.hh>

List of all members.


Detailed Description

Collision handler for dealing with special contact types.

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 ()
ContactfindContact (Object *a, Object *b)
void printSurfacePairs (void)
void printObjectPairs (void)


Member Function Documentation

void ContactCatcher::add Surface a,
Surface b,
ContactFactory t
 

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.

void ContactCatcher::add Object a,
Object b,
ContactFactory t
 

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.

void ContactCatcher::clear  )  [inline]
 

This method clears all previously registered object and surface pairs

Contact* ContactCatcher::findContact Object a,
Object b
 

This method searches previously established contacts for the specified pair.

void ContactCatcher::handle void   ) 
 

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.

void ContactCatcher::update DeTimeEvent *  event  ) 
 

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.


SimLib Reference Documentation