Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8110 in orxonox.OLD


Ignore:
Timestamp:
Jun 2, 2006, 12:53:16 AM (18 years ago)
Author:
patrick
Message:

cr: collision reaction: deal damage done

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

Legend:

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

    r8109 r8110  
    9393    c = this->collisionList.back();
    9494
    95   c->collide(entityA, entityB);
    96   c->setEntityACollide(true);
    9795  this->collisionList.push_back(c);
    9896
     
    118116  // set the state to not dispatched
    119117  this->bDispatched = false;
     118  collision->setEntityBCollide(true);
    120119
    121120  this->collisionList.push_back(collision);
     
    137136  // first element only
    138137 Collision* c = this->registerCollision(collisionEvent->getEntityA(), collisionEvent->getEntityB());
     138 c->setEntityACollide(true);
     139
    139140 c->registerCollisionEvent(collisionEvent);
    140 
    141141}
    142142
  • branches/cr/src/lib/collision_reaction/cr_object_damage.cc

    r8108 r8110  
    5252void CRObjectDamage::reactToCollision(Collision* collision)
    5353{
     54  float damage;
    5455
    55 //   if(collision->)
     56  // the collision damage been dealed by the entity
     57  if( collision->isEntityACollide()) {
     58    damage = collision->getEntityB()->getHealthMax();
     59    collision->getEntityA()->decreaseHealth(damage);
     60  }
     61  if( collision->isEntityBCollide()) {
     62    damage = collision->getEntityA()->getHealthMax();
     63    collision->getEntityB()->decreaseHealth(damage);
     64  }
    5665
    5766//   const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
Note: See TracChangeset for help on using the changeset viewer.