Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4551 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 8, 2005, 10:59:50 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: further work on the test env, cdengine draw functions, debug functions

Location:
orxonox/trunk/src
Files:
6 edited

Legend:

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

    r4546 r4551  
    3030   this->setClassName("CDEngine");
    3131   this->setClassID(CL_CD_ENGINE, "CDEngine");
     32
     33   /* testing purposes only: */
     34   this->rootTree = new OBBTree();
    3235}
    3336
     
    4851
    4952
     53
     54void CDEngine::drawBV(int currentDepth, const int depth) const
     55{
     56  /* this would operate on  worldList bases, for testing purposes, we only use one OBBTree */
     57  this->rootTree->drawBV(currentDepth, depth);
     58}
     59
     60
     61void CDEngine::drawBVPolygon(int currentDepth, const int depth) const
     62{}
     63
     64
     65void CDEngine::drawBVBlended(int currentDepth, const int depth) const
     66{}
     67
     68
     69
    5070void CDEngine::debug()
    5171{
    5272  PRINT(0)("\n=============================| CDEngine::debug() |===\n");
    5373  PRINT(0)("=  CDEngine: Spawning Tree Start\n");
    54 
     74  this->rootTree->debug();
    5575  PRINT(0)("=  CDEngine: Spawning Tree: Finished\n");
    5676  PRINT(0)("=======================================================\n");     
  • orxonox/trunk/src/lib/collision_detection/cd_engine.h

    r4546 r4551  
    1313template<class T> class tList;
    1414class WorldEntity;
     15class OBBTree;
    1516
    1617
     
    6364  int                     state;                            //!< the current state of the cd engine
    6465  tList<WorldEntity>*     entityList;                       //!< pointer to the world entity list
     66  OBBTree*                rootTree;                         //!< for testing purposes a root tree
    6567};
    6668
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4550 r4551  
    4545
    4646
    47 void OBBTree::spawnBVTree(int depth)
     47void OBBTree::spawnBVTree(int depth, sVec3D *verticesList, const int length)
    4848{
    49  
     49  if( unlikely(this->rootNode != NULL))
     50    {
     51      PRINTF(2)("The BVTree has already been spawned, flushing and respawning again...\n");
     52      this->flushTree();
     53    }
     54  OBBTreeNode* node = new OBBTreeNode();
     55  this->rootNode = node;
     56  this->rootNode->spawnBVTree(depth, verticesList, length);
    5057}
    5158
     
    8491  PRINT(0)("\n==============================| OBBTree::debug() |===\n");
    8592  PRINT(0)("=  Spawning Tree: Start\n");
    86   this->spawnBVTree(1);
     93 
     94  /* generate some test vertices */
     95  sVec3D vertList[] = {{1.0, 3.0, 4.0},{3.5, 6.2, 9.6},{6.4, 9.0, 2.0}};
     96
     97  this->spawnBVTree(1, vertList, 3);
     98
    8799  PRINT(0)("=  Spawning Tree: Finished\n");
    88100  PRINT(0)("=======================================================\n");     
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r4550 r4551  
    99
    1010#include "bv_tree.h"
    11 
     11#include "abstract_model.h"
    1212
    1313class OBBTreeNode;
     
    2020  virtual ~OBBTree();
    2121
    22   virtual void spawnBVTree(int depth);
     22  virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length);
    2323  virtual void flushTree();
    2424
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4550 r4551  
    103103        }
    104104    }
     105
     106  printf("Covariance Matrix:\n");
     107    for(int j = 0; j < 3; ++j)
     108    {
     109      printf(" |");
     110      for(int k = 0; k < 3; ++k)
     111        {
     112          printf(" \b%f ", covariance[j][k]);
     113        }
     114      printf(" |\n");
     115    }
    105116}
    106117
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4546 r4551  
    5151void Framework::moduleDraw() const
    5252{
     53  CDEngine::getInstance()->drawBV(1,1);
    5354}
    5455
Note: See TracChangeset for help on using the changeset viewer.