Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8109 in orxonox.OLD for branches/cr/src


Ignore:
Timestamp:
Jun 1, 2006, 11:34:14 PM (19 years ago)
Author:
patrick
Message:

cr: one sideded filter for collision events

Location:
branches/cr/src/lib/collision_reaction
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cr/src/lib/collision_reaction/collision_handle.cc

    r8108 r8109  
    129129void CollisionHandle::registerCollisionEvent(CollisionEvent* collisionEvent)
    130130{
     131  if( !this->filterCollisionEvent(collisionEvent))
     132    return;
     133
    131134  // set the state to not dispatched
    132135  this->bDispatched = false;
     
    165168  this->flushCollisions();
    166169}
     170
     171
     172/**
     173 * filter out the CollisionEvents that are not wanted
     174 *  @param collisionEvent the collision event to filter
     175 */
     176bool CollisionHandle::filterCollisionEvent(CollisionEvent* collisionEvent)
     177{
     178  vector<long>::iterator it = this->targetList.begin();
     179  for(; it < this->targetList.end(); it++)
     180  {
     181    if( !collisionEvent->getEntityA()->isA((ClassID)(*it)))
     182      return false;
     183  }
     184
     185  return true;
     186}
     187
     188
     189
     190
     191
     192
     193
     194
  • branches/cr/src/lib/collision_reaction/collision_handle.h

    r8106 r8109  
    4646  private:
    4747    void flushCollisions();
     48    bool filterCollisionEvent(CollisionEvent* collisionEvent);
    4849
    4950
Note: See TracChangeset for help on using the changeset viewer.