Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6135 in orxonox.OLD for branches/objectmanager/src/lib


Ignore:
Timestamp:
Dec 16, 2005, 6:01:26 PM (19 years ago)
Author:
bensch
Message:

om: safer collision-test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/objectmanager/src/lib/collision_detection/cd_engine.cc

    r6124 r6135  
    110110{
    111111  BVTree* tree;
    112   std::list<WorldEntity*>::iterator entity1, entity2;
     112  std::list<WorldEntity*>::iterator entity1, entity2, pre1, pre2;
    113113  PRINTF(3)("checking for collisions\n");
    114   for (entity1 = list1.begin(); entity1 != list1.end(); entity1++)
     114
     115  pre1 = list1.begin();
     116  while (pre1 != list1.end())
    115117  {
     118    entity1 = pre1;
     119    pre1++;
    116120    if( likely((*entity1) != this->terrain))
    117121    {
    118       for (entity2 = list2.begin(); entity2 != list2.end(); entity2++)
     122      pre2 = list2.begin();
     123      while (pre2 != list2.end())
    119124      {
     125        entity2 = pre2;
     126        pre2++;
    120127        if( likely((*entity2) != this->terrain))
    121128        {
Note: See TracChangeset for help on using the changeset viewer.