Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10355 in orxonox.OLD for branches/ODE/src/lib/collision_detection


Ignore:
Timestamp:
Jan 24, 2007, 8:48:26 PM (18 years ago)
Author:
bottac
Message:

Here comes the updated version.

Location:
branches/ODE
Files:
1 edited
1 copied

Legend:

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

    r10033 r10355  
    6868void CDEngine::checkCollisions(ObjectManager::EntityList& list1, ObjectManager::EntityList& list2)
    6969{
     70
     71
    7072  BVTree* tree;
    7173  ObjectManager::EntityList::iterator entity1, entity2, pre1, pre2;
     
    8486        if( likely((*entity2) != this->terrain))
    8587        {
     88         
    8689          PRINTF(5)("checking object %s (%s) against %s (%s)\n",
    87             (*entity1)->getClassCName(), (*entity1)->getCName(), (*entity2)->getClassCName(), (*entity2)->getCName());
     90           (*entity1)->getClassCName(), (*entity1)->getCName(), (*entity2)->getClassCName(), (*entity2)->getCName());
     91          #ifndef WITH_ODE
    8892          tree = (*entity1)->getOBBTree();
    8993          if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL)
    90             tree->collideWith(*entity1, *entity2);
     94          tree->collideWith(*entity1, *entity2);
     95          #endif
     96                (*entity1)->checkCollision(*entity2);
     97       
     98         
    9199        }
    92100      }
     
    102110{
    103111  std::list<WorldEntity*>::iterator entityIterator;
     112       
     113for( ObjectList<Terrain>::const_iterator bspIterator = Terrain::objectList().begin();
     114       bspIterator != Terrain::objectList().end();
     115       bspIterator++) {
     116   for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++)
     117      {
     118                PRINTF(5)("Checking %s against: %s\n", ((dynamic_cast<Terrain*>(*bspIterator)))->getCName(),    (*entityIterator)->getClassCName());
     119        (dynamic_cast<Terrain*>(*bspIterator))->checkCollision(*entityIterator);
     120      }
     121 }
     122       
    104123  // for all bsp managers check all entities
    105124  for( ObjectList<BspEntity>::const_iterator bspIterator = BspEntity::objectList().begin();
     
    108127      for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++)
    109128      {
    110 //         PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassCName());
     129       //  PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getCName(), (*entityIterator)->getClassCName());
    111130        (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator);
    112131      }
     132   
    113133  }
     134 
    114135}
    115136
Note: See TracChangeset for help on using the changeset viewer.