Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9981 in orxonox.OLD


Ignore:
Timestamp:
Dec 2, 2006, 3:34:37 PM (17 years ago)
Author:
patrick
Message:

closed the collision reaction loop

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

Legend:

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

    r9980 r9981  
    4444  {
    4545    this->registerObject(this, CollisionTube::_objectList);
     46
     47
     48    // push the collision reaction object on the list in the right order
     49    // WARNING: do not mess with the order, it should be the same as in
     50
     51    // physical reactions
     52    this->_reactionList[CREngine::CR_PHYSICS_MOMENTUM]      = NULL;
     53    this->_reactionList[CREngine::CR_PHYSICS_STEP_BACK]     = NULL;
     54    this->_reactionList[CREngine::CR_PHYSICS_GROUND_WALK]   = new CRPhysicsGroundWalk();
     55    this->_reactionList[CREngine::CR_PHYSICS_FULL_WALK]     = new CRPhysicsFullWalk();
     56    this->_reactionList[CREngine::CR_PHYSICS_DAMAGE]        = NULL;
     57    // object based reactions
     58    this->_reactionList[CREngine::CR_OBJECT_DAMAGE]         = new CRObjectDamage();
     59    this->_reactionList[CREngine::CR_OBJECT_PICKUP]         = NULL;
     60    // misc reactions
     61    this->_reactionList[CREngine::CR_VERTEX_TRAFO]          = NULL;
     62    this->_reactionList[CREngine::CR_SPECIAL_CALLBACK]      = NULL;
    4663  }
    4764
     
    123140    for(; ci < this->_collisionList.end(); ++ci)
    124141    {
    125       // check if entity A is subscibed for this event
    126       (*ci)->getEntityA()->
    127 
    128       // check if entity B is subscribed for this event
    129 
     142      for( int i = CREngine::CR_PHYSICS_MOMENTUM; i < CREngine::CR_NUBER; i++)
     143      {
     144        // check if entity A or B is subscibed for this event
     145        if( (*ci)->getEntityA()->bReactibe((*it)->getEnityB(), i) || (*ci)->getEntityB()->bReactibe((*it)->getEnityA(), i))
     146          (*ci)->reactToCollision(*ci);
     147      }
    130148    }
    131149  }
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.h

    r9980 r9981  
    7171
    7272  private:
    73     std::vector<Collision*>        _collisionList;      //!< the list of collisions since the last processing
     73    std::vector<Collision*>         _collisionList;                      //!< the list of collisions since the last processing
     74    CollisionReaction*              _reactionList[CREngine::CR_NUMBER];  //!< the collision reaction list containing all reactions types
    7475
    7576
Note: See TracChangeset for help on using the changeset viewer.