Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9980 in orxonox.OLD


Ignore:
Timestamp:
Dec 2, 2006, 2:43:13 PM (17 years ago)
Author:
patrick
Message:

collision reaction revisited: starting end run

Location:
branches/coll_rect/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/coll_rect/src/lib/collision_reaction/collision.cc

    r9889 r9980  
    5151    this->bDispatched = true;
    5252
    53     this->collisionEvents.clear();
     53    this->_collisionEvents.clear();
    5454  }
    5555
  • branches/coll_rect/src/lib/collision_reaction/collision_filter.cc

    r9939 r9980  
    7171    {
    7272      //check if this class isn't already registered
    73       std::vector<ClassID>::iterator it = this->_filters[type].begin();
     73      TargetIterator it = this->_filters[type].begin();
    7474      for(; it != this->_filters[type].end(); it++)
    7575      {
     
    141141    for( int i = 0; i < CREngine::CR_NUMBER; i++ )
    142142    {
    143       std::vector<ClassID>::const_iterator it = this->_filters[i].begin();
     143      TargetIterator it = this->_filters[i].begin();
    144144      for(; it != this->_filters[i].end(); i++ )
    145145        if( unlikely(entity.isA(*it)))
     
    160160  bool CollisionFilter::operator()(const WorldEntity& entity, const CREngine::ReactionType type) const
    161161  {
    162     // if there are no installed criterions just ommit and
    163     if( this->bReactive())
     162    // if there are no installed criterions just omit and return
     163    if( !this->bReactive())
    164164      return false;
    165165
    166166    // goes through all registered filter criterions and looks for matches
    167     std::vector<ClassID>::const_iterator it = this->_filters[type].begin();
     167    TargetIterator it = this->_filters[type].begin();
    168168    for(; it != this->_filters[type].end(); it++ )
    169169      if( unlikely(entity.isA(*it)))
  • branches/coll_rect/src/lib/collision_reaction/collision_filter.h

    r9939 r9980  
    3535    ObjectListDeclaration(CollisionFilter);
    3636
     37
     38    typedef std::vector<ClassID>::iterator    TargetIterator;
    3739
    3840    /* Constructor/Deconstructors */
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.cc

    r9939 r9980  
    120120  {
    121121    // for all collisions:
    122     std::vector<Collision*>::iterator collisions = this->_collisionList.begin();
    123     for(; collisions < this->_collisionList.end(); collisions++)
     122    CollisionIterator ci = this->_collisionList.begin();
     123    for(; ci < this->_collisionList.end(); ++ci)
    124124    {
     125      // check if entity A is subscibed for this event
     126      (*ci)->getEntityA()->
    125127
     128      // check if entity B is subscribed for this event
    126129
    127       // for all collision events of each collision:
    128       Collision::iterator events = (*collisions)->begin();
    129       for(; events < (*collisions)->end(); events++)
    130       {
    131 
    132       }
    133130    }
    134131  }
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.h

    r9939 r9980  
    4848    ObjectListDeclaration(CollisionTube);
    4949
     50    typedef std::vector<Collision*>::iterator     CollisionIterator;
    5051
    5152    /* Constructor/Deconstructor/Singleton Interface */
  • branches/coll_rect/src/world_entities/world_entity.h

    r9939 r9980  
    9292  /** @return true if there is at least on collision reaction subscribed */
    9393  inline bool isReactive() const { return this->bReactive; }
     94
     95  /** @param worldEntity the world entity to be checked @returns true if there is a collisionreaction registered for the worldEntity */
    9496  inline bool isReactive( const WorldEntity& worldEntity) const { return this->isReactive() || (this->_collisionFilter(worldEntity)); }
     97  /** @param worldEntity the world entity to be checked @param type special reaction type @returns true if collision reaction reg. */
     98  inline bool isReactive( const WorldEntity& worldEntity, CoRe::ReactionType type) const
     99  { return this->isReactive() || (this->_collisionFilter(worldEntity, type)); }
     100
    95101
    96102  const CoRe::CollisionFilter& getCollisionFilter(CoRe::CREngine::ReactionType type) const { return this->_collisionFilter; }
Note: See TracChangeset for help on using the changeset viewer.