Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8490 in orxonox.OLD for trunk/src/lib/collision_detection


Ignore:
Timestamp:
Jun 15, 2006, 9:34:48 PM (18 years ago)
Author:
patrick
Message:

merged the bsp branche back to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/cd_engine.cc

    r8316 r8490  
    2020#include "debug.h"
    2121
     22#include "class_list.h"
     23
    2224#include "model.h"
    2325#include "world_entity.h"
     
    3032
    3133#include "bsp_manager.h"
     34#include "bsp_entity.h"
    3235
    3336using namespace std;
     
    97100void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1)
    98101{
    99   if( likely( this->terrain != NULL))
    100   {
    101 //    Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree();
    102 //    QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
    103   }
    104102
    105   if( likely( this->bspManager != NULL))
    106   {
    107     std::list<WorldEntity*>::iterator iterator;
    108     PRINTF(3)("checking for collisions\n");
     103  std::list<BaseObject*>::const_iterator bspIterator;
     104  std::list<WorldEntity*>::iterator entityIterator;
     105  const std::list<BaseObject*>* bspList = ClassList::getList(CL_BSP_ENTITY);
     106  if( bspList == NULL)
     107    return;
    109108
    110     iterator = list1.begin();
    111     while (iterator != list1.end())
    112     {
    113       bspManager->checkCollision(*iterator);
    114       iterator++;
    115     }
     109  // for all bsp managers check all entities
     110  for( bspIterator = bspList->begin(); bspIterator != bspList->end(); bspIterator++) {
     111      for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++)
     112      {
     113//         PRINTF(0)("Checking: %s a %s\n", (*entityIterator)->getName(), (*entityIterator)->getClassName());
     114        (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollision(*entityIterator);
     115      }
    116116  }
    117117}
     
    128128  PRINT(0)("=  CDEngine: Spawning Tree: Finished\n");
    129129  PRINT(0)("=======================================================\n");
    130 
    131130}
    132131
     
    149148}
    150149
     150
    151151/**
    152152 * this draws the debug spawn tree
Note: See TracChangeset for help on using the changeset viewer.