Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9110 in orxonox.OLD for trunk/src/lib/graphics/spatial_separation


Ignore:
Timestamp:
Jul 4, 2006, 11:18:41 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Presentation back

Location:
trunk/src/lib/graphics/spatial_separation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/spatial_separation/quadtree.cc

    r8293 r9110  
    5252
    5353  /* make an array with access to the leafs of the Quad-Tree */
    54   this->nodes = new QuadtreeNode*[(int)pow(4, treeDepth)];
     54  this->nodes = new QuadtreeNode*[(int)pow(4.0, treeDepth)];
    5555  int index = 0; //new int; *index = 0; // !!changed by bensch!!
    56   for(int i = 0; i < (int)pow(2, treeDepth); ++i)
     56  for(int i = 0; i < (int)pow(2.0, treeDepth); ++i)
    5757  {
    5858    this->rootNode->buildHashTable(this->nodes, &index);
     
    7070  this->offset->x = xOff;
    7171  this->offset->z = yOff;
    72   this->maxIndex = (int)pow(2, this->treeDepth);
     72  this->maxIndex = (int)pow(2.0, this->treeDepth);
    7373}
    7474
     
    103103void Quadtree::revertHashTable(QuadtreeNode** nodes)
    104104{
    105   int                  len         = (int)pow(2, this->treeDepth);          //!< the length of a quadtree side
     105  int                  len         = (int)pow(2.0, this->treeDepth);          //!< the length of a quadtree side
    106106  int                  iterator    = 0;                                     //!< iterator used for mapping
    107107  QuadtreeNode*        tmpNode     = NULL;                                  //!< temp saving place
     
    132132void Quadtree::sortHashTable(QuadtreeNode** nodes)
    133133{
    134   int                  len         = (int)pow(2, this->treeDepth);          //!< the length of a quadtree side
     134  int                  len         = (int)pow(2.0, this->treeDepth);          //!< the length of a quadtree side
    135135  float                a;                                                   //!< temp place for float a
    136136  float                b;                                                   //!< temp place for float b
     
    207207{
    208208  //this->rootNode->drawTree();
    209   for(int i = 0; i < (int)pow(4, this->treeDepth); ++i)
     209  for(int i = 0; i < (int)pow(4.0, this->treeDepth); ++i)
    210210  {
    211211    this->nodes[i]->draw();
  • trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r6022 r9110  
    164164
    165165  /*              offset              #of elements in a row            #of rows in a quadtree          */
    166   int threshold = this->nodeIter + (int)pow(2, this->maxDepth) * (int)pow(2, maxDepth - treeDepth - 1);
     166  int threshold = this->nodeIter + (int)pow(2.0, this->maxDepth) * (int)pow(2.0, maxDepth - treeDepth - 1);
    167167  int loopLimit = (*index < threshold)?2:4;
    168168
Note: See TracChangeset for help on using the changeset viewer.