Changeset 4922 in orxonox.OLD for orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
- Timestamp:
- Jul 21, 2005, 3:59:28 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4921 r4922 135 135 136 136 137 /** 138 139 */ 137 140 void QuadtreeNode::buildHashTable(QuadtreeNode** nodeList, int* index) 138 141 { … … 362 365 Vector center = *this->pDimension->getCenter(); 363 366 float ax = this->pDimension->getAxis(); 367 364 368 if( v.x > center.x - ax && v.x < center.x + ax && 365 369 v.z > center.z - ax && v.z < center.z + ax ) 366 printf("THIS POINT IS INSIDE :) \n"); 367 else 368 printf("POINT IS NOT INSIEDE\n"); 369 this->bDraw = true; 370 } 370 { 371 this->bDraw = true; 372 return true; 373 } 374 return false; 375 } 376 371 377 372 378 /** 373 379 * draws the debug quadtree boxes around the model 374 380 */ 375 void QuadtreeNode::drawTree( int depth, int drawMode) const381 void QuadtreeNode::drawTree() const 376 382 { 377 383 if( this->treeDepth == this->maxDepth) … … 381 387 float h = 50.0f; 382 388 383 //printf("draw @ %f, %f to %f, %f", t1.x + ax, t1.z + ax, t1.x - ax, t1.z - ax);384 385 389 this->quadtree->getMaterial(this->indexNode)->select(); 386 390 glBegin(GL_QUADS); 387 glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z + ax);388 glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z + ax);389 glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z - ax);390 glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z - ax);391 glVertex3f(t1.x + ax, h - this->treeDepth * 10.0f, t1.z + ax); 392 glVertex3f(t1.x - ax, h - this->treeDepth * 10.0f, t1.z + ax); 393 glVertex3f(t1.x - ax, h - this->treeDepth * 10.0f, t1.z - ax); 394 glVertex3f(t1.x + ax, h - this->treeDepth * 10.0f, t1.z - ax); 391 395 glEnd(); 392 396 } … … 394 398 395 399 if( this->nodeA != NULL) 396 this->nodeA->drawTree( depth - 1, drawMode);400 this->nodeA->drawTree(); 397 401 if( this->nodeB != NULL) 398 this->nodeB->drawTree( depth - 1, drawMode);402 this->nodeB->drawTree(); 399 403 if( this->nodeC != NULL) 400 this->nodeC->drawTree( depth - 1, drawMode);404 this->nodeC->drawTree(); 401 405 if( this->nodeD != NULL) 402 this->nodeD->drawTree(depth - 1, drawMode); 403 } 406 this->nodeD->drawTree(); 407 } 408 404 409 405 410 void QuadtreeNode::draw() const … … 411 416 float h = 70.0f; 412 417 413 //printf("draw @ %f, %f to %f, %f", t1.x + ax, t1.z + ax, t1.x - ax, t1.z - ax);414 415 418 glBegin(GL_QUADS); 416 419 this->quadtree->getMaterial(this->indexNode)->select(); 417 // for( int i = 0; i < 50; ++i) 418 // { 419 int i = 0; 420 glVertex3f(t1.x + ax, h + 10.0f * i, t1.z + ax); 421 glVertex3f(t1.x - ax, h + 10.0f * i, t1.z + ax); 422 glVertex3f(t1.x - ax, h + 10.0f * i, t1.z - ax); 423 glVertex3f(t1.x + ax, h + 10.0f * i, t1.z - ax); 424 // } 420 421 glVertex3f(t1.x + ax, h, t1.z + ax); 422 glVertex3f(t1.x - ax, h, t1.z + ax); 423 glVertex3f(t1.x - ax, h, t1.z - ax); 424 glVertex3f(t1.x + ax, h, t1.z - ax); 425 425 426 glEnd(); 426 427
Note: See TracChangeset
for help on using the changeset viewer.