Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2006, 9:06:41 PM (18 years ago)
Author:
patrick
Message:

bsp: integrating the bspmanager fully into the collision detection/reaction system

File:
1 edited

Legend:

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

    r8186 r8213  
    1919#include "obb_tree.h"
    2020#include "debug.h"
     21
     22#include "class_list.h"
    2123
    2224#include "model.h"
     
    9799void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1)
    98100{
    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   }
    104  
    105   if( likely( this->bspManager != NULL))
    106   {
    107     std::list<WorldEntity*>::iterator iterator;
    108     PRINTF(3)("checking for collisions\n");
    109101
    110     iterator = list1.begin();
    111     while (iterator != list1.end())
    112     {
    113       bspManager->checkCollision(*iterator);
    114       iterator++;
    115     }
     102  std::list<WorldEntity*>::iterator entityIterator;
     103  std::list<BaseObject*>::const_iterator bspIterator;
     104  const std::list<BaseObject*>* list = ClassList::getList(CL_BSP_MODEL);
     105
     106  // for all bsp managers check all entities
     107  for( bspIterator = list->begin(); bspIterator != list->end(); bspIterator++) {
     108      for(entityIterator = list1.begin(); entityIterator != list1.end(); entityIterator++)
     109        static_cast<BspManager*>(*bspIterator)->checkCollision(*entityIterator);
    116110  }
    117111}
Note: See TracChangeset for help on using the changeset viewer.