Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 6, 2006, 1:39:46 AM (19 years ago)
Author:
patrick
Message:

cr: collision reaction now works: dealing damage

File:
1 edited

Legend:

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

    r8166 r8167  
    114114    c->collide(entityA, entityB);
    115115    this->collisionList.push_back(c);
     116
     117    // now register it as a shared collision with the other collision entity
     118    CollisionHandle* ch = entityB->getCollisionHandle(this->type);
     119    if( ch != NULL)
     120      ch->registerSharedCollision(c);
    116121  }
    117122  else
     
    120125  assert( c->getEntityA() != NULL);
    121126  assert( c->getEntityB() != NULL);
    122 
    123   // now register it as a shared collision with the other collision entity
    124   CollisionHandle* ch = entityB->getCollisionHandle(this->type);
    125   if( ch != NULL)
    126     ch->registerSharedCollision(c);
    127127
    128128  return c;
     
    190190  vector<Collision*>::iterator it = this->collisionList.begin();
    191191  for(; it < this->collisionList.end(); it++) {
    192     this->collisionReaction->reactToCollision(*it);
    193     (*it)->flushCollisionEvents();
     192    if( !(*it)->isDispatched())
     193    {
     194      this->collisionReaction->reactToCollision(*it);
     195      (*it)->flushCollisionEvents();
     196    }
    194197  }
    195198
Note: See TracChangeset for help on using the changeset viewer.