Changeset 4888 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation
- Timestamp:
- Jul 18, 2005, 10:13:41 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4887 r4888 100 100 void QuadtreeNode::separateNode(int treeDepth, const int maxDepth) 101 101 { 102 this->treeDepth = treeDepth; 103 /* debug output */ 102 104 for( int i = 0; i < treeDepth; ++i) 103 PRINT(3)(" "); 104 PRINT(3)(" +-| (Event) Separating Node Depth: %i/%i\n", treeDepth, maxDepth); 105 105 PRINT(3)(" |"); 106 PRINT(3)(" | +-| (Event) Separating Node Depth: %i/%i\n", treeDepth, maxDepth); 107 108 /* dimension calculation & limit checking */ 106 109 this->pDimension = this->getDimension(); 107 108 this->treeDepth = treeDepth;109 110 if( treeDepth >= maxDepth) 110 111 return; 111 112 113 /* node separation */ 112 114 this->separateNode(); 113 114 115 this->nodeA->separateNode(treeDepth + 1, maxDepth); 115 116 this->nodeB->separateNode(treeDepth + 1, maxDepth); … … 125 126 void QuadtreeNode::separateNode(float minLength) 126 127 { 128 /* dimension calculation & limit checking */ 127 129 this->pDimension = this->getDimension(); 128 129 130 if( minLength <= this->pDimension->getAxis()) 130 131 return; 131 132 133 /* node separation */ 132 134 this->separateNode(); 133 134 135 this->nodeA->separateNode(minLength); 135 136 this->nodeB->separateNode(minLength); … … 169 170 } 170 171 for( int i = 0; i < treeDepth; ++i) 171 PRINT(3)(" 172 PRINT(3)(" 172 PRINT(3)(" |"); 173 PRINT(3)(" | +-| (II) Quadtree Counts: A: %i, B: %i, C: %i, D: %i\n", listA->getSize(), listB->getSize(), listC->getSize(), listD->getSize()); 173 174 174 175 /* Separating into to the triangle lists */ … … 309 310 310 311 for( int i = 0; i < this->treeDepth; ++i) 311 PRINT(3)(" 312 PRINT(3)(" +-| (II) Rectangle Dimension (%f, %f) to (%f, %f), Center (%f, %f)\n", minX, minY, maxX, maxY, rect->getCenter()->x, rect->getCenter()->z, rect->getAxis());312 PRINT(3)(" |"); 313 PRINT(3)(" | +-| (II) Rectangle Dimension (%5.2f, %5.2f) to (%5.2f, %5.2f), Center (%5.2f, %5.2f)\n", minX, minY, maxX, maxY, rect->getCenter()->x, rect->getCenter()->z, rect->getAxis()); 313 314 return rect; 314 315 } … … 356 357 357 358 for( int i = 0; i < this->treeDepth; ++i) 358 PRINT(3)(" 359 PRINT(3)(" +-| (II) Rectangle Dimension (%f, %f) to (%f, %f), Center (%f, %f)\n", minX, minY, maxX, maxY, rect->getCenter()->x, rect->getCenter()->z, rect->getAxis());359 PRINT(3)(" |"); 360 PRINT(3)(" | +-| (II) Rectangle Dimension (%5.2f, %5.2f) to (%5.2f, %5.2f), Center (%5.2f, %5.2f)\n", minX, minY, maxX, maxY, rect->getCenter()->x, rect->getCenter()->z, rect->getAxis()); 360 361 return rect; 361 362 }
Note: See TracChangeset
for help on using the changeset viewer.