opal::CollisionEventHandler Class Reference

#include <CollisionEventHandler.h>

Inheritance diagram for opal::CollisionEventHandler:

opal::EventHandler List of all members.

Public Member Functions

OPAL_DECL CollisionEventHandler ()
virtual OPAL_DECL ~CollisionEventHandler ()
virtual OPAL_DECL void OPAL_CALL handleCollisionEvent (const CollisionEvent &e)=0
virtual OPAL_DECL void OPAL_CALL internal_pushCollisionEvent (const CollisionEvent &e)
virtual OPAL_DECL void OPAL_CALL internal_handlePendingCollisionEvents ()

Protected Attributes

std::vector< CollisionEventmPendingCollisionEvents

Detailed Description

A listener that gets notified when two Solids touch. These events get handled at the end of the time step, which is necessary because some physics engines cannot update objects in the middle of a time step (e.g. in the middle of collision detection).

Definition at line 75 of file CollisionEventHandler.h.


Constructor & Destructor Documentation

opal::CollisionEventHandler::CollisionEventHandler  ) 
 

Definition at line 32 of file CollisionEventHandler.cpp.

opal::CollisionEventHandler::~CollisionEventHandler  )  [virtual]
 

Definition at line 36 of file CollisionEventHandler.cpp.

References mPendingCollisionEvents.


Member Function Documentation

virtual OPAL_DECL void OPAL_CALL opal::CollisionEventHandler::handleCollisionEvent const CollisionEvent e  )  [pure virtual]
 

Called once for each pending CollisionEvent. This is always called at the end of every time step so CollisionEvents get handled right away.

Referenced by internal_handlePendingCollisionEvents().

void opal::CollisionEventHandler::internal_handlePendingCollisionEvents  )  [virtual]
 

Loops through the pending CollisionEvents, calling the event handling function (which is always user-defined) for each.

Definition at line 47 of file CollisionEventHandler.cpp.

References handleCollisionEvent(), and mPendingCollisionEvents.

void opal::CollisionEventHandler::internal_pushCollisionEvent const CollisionEvent e  )  [virtual]
 

Adds a CollisionEvent to this handler's internal list. These will get handled at the end of the current time step.

Definition at line 41 of file CollisionEventHandler.cpp.

References mPendingCollisionEvents.

Referenced by opal::ode_hidden::internal_collisionCallback().


Member Data Documentation

std::vector<CollisionEvent> opal::CollisionEventHandler::mPendingCollisionEvents [protected]
 

This list holds pending CollisionEvents. It allows events to be queued during collision detection and handled at a safe time.

Definition at line 101 of file CollisionEventHandler.h.

Referenced by internal_handlePendingCollisionEvents(), internal_pushCollisionEvent(), and ~CollisionEventHandler().


The documentation for this class was generated from the following files:
Generated on Tue May 16 17:49:55 2006 for OPAL by  doxygen 1.4.6-NO