Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9172 in orxonox.OLD for branches/presentation/src/lib


Ignore:
Timestamp:
Jul 4, 2006, 9:45:39 PM (18 years ago)
Author:
patrick
Message:

less debug more boxes creation obb

Location:
branches/presentation/src/lib/collision_detection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/collision_detection/obb_tree.cc

    r8316 r9172  
    4141
    4242
     43/**
     44 *  standard constructor
     45 */
     46OBBTree::OBBTree()
     47  : BVTree()
     48{}
     49
    4350
    4451void OBBTree::init()
     
    7885
    7986  this->rootNode->spawnBVTree(modelInf, triangleIndexes, modelInf.numTriangles);
     87}
     88
     89
     90void OBBTree::createBox(Vector start, Vector end)
     91{
     92  this->rootNode = new OBBTreeNode(*this, NULL, 11);
     93
     94  this->rootNode->createBox(start, end);
    8095}
    8196
  • branches/presentation/src/lib/collision_detection/obb_tree.h

    r7711 r9172  
    2323  public:
    2424    OBBTree(int depth, const modelInfo* modInfo, WorldEntity* entity);
     25    OBBTree();
    2526    virtual ~OBBTree();
    2627    void init();
     
    2829    virtual void spawnBVTree(const modelInfo& modelInf);
    2930    virtual void flushTree();
     31
     32    void createBox(Vector start, Vector end);
    3033
    3134    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2);
  • branches/presentation/src/lib/collision_detection/obb_tree_node.cc

    r9008 r9172  
    9090    delete this->bvElement;
    9191}
     92
     93
     94
     95void OBBTreeNode::createBox(Vector start, Vector end)
     96{
     97
     98  this->bvElement = new OBB();
     99  this->nodeLeft = NULL;
     100  this->nodeRight = NULL;
     101
     102  this->bvElement->center = (end - start) * 0.5f;
     103  this->bvElement->halfLength[0] = (end.x - start.x) * 0.5f;
     104  this->bvElement->halfLength[1] = (end.y - start.y) * 0.5f;
     105  this->bvElement->halfLength[2] = (end.z - start.z) * 0.5f;
     106}
     107
    92108
    93109
     
    682698    if( depth == 0/*!(drawMode & DRAW_SINGLE && depth != 0)*/)
    683699    {
    684       if( 1 /*drawMode & DRAW_POINTS*/)
     700      if( 0 /*drawMode & DRAW_POINTS*/)
    685701      {
    686702        glBegin(GL_POINTS);
  • branches/presentation/src/lib/collision_detection/obb_tree_node.h

    r7732 r9172  
    3131
    3232    virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length);
     33    void createBox(Vector start, Vector end);
    3334
    3435    virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
Note: See TracChangeset for help on using the changeset viewer.