Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7999 in orxonox.OLD for branches/cr


Ignore:
Timestamp:
May 30, 2006, 11:38:37 PM (18 years ago)
Author:
patrick
Message:

cr: collision/collision event creation and resycling works now

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

Legend:

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

    r7996 r7999  
    6060void CollisionHandle::addTarget(long target)
    6161{
    62   PRINTF(0)("addTarget: %i \n", target);
    6362  // make sure there is no dublicate
    64 //   for(int i = 0; i < this->targetList.size(); ++i)
    65 //     printf("id: %i\n", this->targetList[i]);
    66 
    67 //   std::vector<long>::iterator it = this->targetList.begin();
    68 //   for( ; it < this->targetList.end(); it++)
    69 //     printf("id: %i\n", *it);
    70 //     if( (*it) == classID)
    71 //       return;
    72 
     63  std::vector<long>::iterator it = this->targetList.begin();
     64  for( ; it < this->targetList.end(); it++)
     65    if( (*it) == target)
     66      return;
    7367
    7468  // add element
    75    this->targetList.push_back(10);
     69   PRINTF(0)("addTarget: %i \n", target);
     70   this->targetList.push_back(target);
    7671}
    7772
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7996 r7999  
    111111  CollisionHandle* ch = new CollisionHandle(owner, type);
    112112  this->collisionHandles.push_back(ch);
     113
     114  return ch;
    113115}
    114116
     
    157159void CREngine::flushCollisions()
    158160{
    159   vector<Collision*>::iterator it = this->collisionsUsed.begin();
    160   for(; it < this->collisionsUsed.end(); it++)
    161     this->collisionsUnused.push_back(*it);
     161  vector<Collision*>::iterator it1 = this->collisionsUsed.begin();
     162  for(; it1 < this->collisionsUsed.end(); it1++)
     163    this->collisionsUnused.push_back(*it1);
     164
     165  vector<CollisionEvent*>::iterator it2 = this->collisionEventsUsed.begin();
     166  for(; it2 < this->collisionEventsUsed.end(); it2++)
     167    this->collisionEventsUnused.push_back(*it2);
    162168
    163169  this->collisionsUsed.clear();
Note: See TracChangeset for help on using the changeset viewer.