Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2006, 4:28:11 PM (19 years ago)
Author:
patrick
Message:

giving the crengine the ability to check for collisions itself, collision tube only used as container

File:
1 edited

Legend:

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

    r9983 r9985  
    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;
    6346  }
    6447
     
    131114
    132115
    133   /**
    134    * handles all collisions in registered in this tube
    135    */
    136   void CollisionTube::handleCollisions()
    137   {
    138     // for all collisions:
    139     CollisionIterator ci = this->_collisionList.begin();
    140     for(; ci < this->_collisionList.end(); ++ci)
    141     {
    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 
    148         (*ci)->flushCollisionEvents();
    149       }
    150     }
    151   }
    152 
    153 
    154 
    155 
    156 
    157 
    158 
    159116}// namespace end
    160117
Note: See TracChangeset for help on using the changeset viewer.