Changeset 4914 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
- Timestamp:
- Jul 21, 2005, 11:17:54 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4913 r4914 101 101 102 102 this->offset = 0.0f; 103 this->nodeIter = 0;103 this->nodeIter = -1; 104 104 105 105 this->parent = NULL; … … 136 136 void QuadtreeNode::buildHashTable(QuadtreeNode** nodeList, int* index) 137 137 { 138 i nt elCount = (int)pow(4, maxDepth - treeDepth) / 2;139 int loopLimit = (this->nodeIter < elCount)?2:4;140 141 for( int i = 0; i < this->treeDepth; ++i)142 printf(" ");143 printf("entering %i: hit counts: %i/%i\n", treeDepth, nodeIter, elCount);138 if( this->nodeIter == -1) 139 this->nodeIter = *index; 140 141 /* offset #of elements in a row #of rows in a quadtree */ 142 int threshold = this->nodeIter + (int)pow(2, this->maxDepth) * (int)pow(2, maxDepth - treeDepth - 1); 143 int loopLimit = (*index < threshold)?2:4; 144 144 145 145 /* is it a leaf? */ 146 146 if( this->treeDepth < this->maxDepth) 147 { 148 for(int i = (this->nodeIter < elCount)?0:2; i < loopLimit; ++i) 149 { 150 for( int j = 0; j < this->treeDepth; ++j) 151 printf(" "); 152 printf("-> %i @ depth: %i, %i/%i \n", i, this->treeDepth, nodeIter, elCount); 153 147 for(int i = (*index < threshold)?0:2; i < loopLimit; ++i) 154 148 this->nodes[i]->buildHashTable(nodeList, index); 155 ++this->nodeIter;156 }157 }158 149 else 159 {160 for( int j = 0; j < this->treeDepth; ++j)161 printf(" ");162 printf(" leaf, index: %i, pointer: %p\n", *index, this);163 150 nodeList[(*index)++] = this; 164 }165 151 } 166 152
Note: See TracChangeset
for help on using the changeset viewer.