Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2006, 5:10:54 PM (18 years ago)
Author:
bensch
Message:

merges some merges

Location:
branches/bsp_model/src/lib/collision_detection
Files:
2 edited

Legend:

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

    r7739 r8087  
    2929#include "quadtree_node.h"
    3030
    31 
     31#include "bsp_manager.h"
    3232
    3333using namespace std;
     
    9595 *  this checks the collisions with the ground
    9696 */
    97 void CDEngine::checkCollisionGround()
     97void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1)
    9898{
    9999  if( likely( this->terrain != NULL))
    100100  {
    101101    Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree();
    102 
    103102//    QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
    104103  }
    105   //sTriangleExt* tri = q->getTriangleFromPosition(this->player->getAbsCoor());
     104 
     105  if( likely( this->bspManager != NULL))
     106  {
     107    std::list<WorldEntity*>::iterator iterator;
     108    PRINTF(3)("checking for collisions\n");
     109
     110    iterator = list1.begin();
     111    while (iterator != list1.end())
     112    {
     113      bspManager->checkCollision(*iterator);
     114      iterator++;
     115    }
     116  }
    106117}
    107118
  • branches/bsp_model/src/lib/collision_detection/cd_engine.h

    r7739 r8087  
    1717class OBBTree;
    1818class Terrain;
     19class BspManager;
    1920//class Player;
    2021
     
    5051
    5152  inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
     53  inline void setBSPModel(BspManager* bspManager) { this->bspManager = bspManager; }
    5254
    5355  void checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2);
     56  void checkCollisionGround(std::list<WorldEntity*>& list1);
    5457
    5558  void drawBV(const std::list<WorldEntity*>& drawList, int level) const;
     
    6972
    7073  void checkCollisionObjects();
    71   void checkCollisionGround();
     74
    7275
    7376  void debugSpawnTree(int depth, sVec3D* vertices, int numVertices);
     
    8184
    8285  Terrain*                terrain;                          //!< this it a ref to the terrain, serving as a ground for all WE
     86  BspManager*             bspManager;
    8387};
    8488
Note: See TracChangeset for help on using the changeset viewer.