Changeset 4921 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 21, 2005, 3:32:54 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/spatial_separation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
r4920 r4921 162 162 printf("-----------\nthe array coordinates are: %i, %i\n", i, j); 163 163 printf("position: %f,%f, center %f, %f\n", position.x, position.z, this->nodes[i + j * max]->getDimension()->getCenter()->x, this->nodes[i + j * max]->getDimension()->getCenter()->z); 164 this->nodes[i + j * max]->drawTree(0,0); 164 165 //this->nodes[i + j * max]->draw(); 165 166 this->nodes[i + j * max]->includesPoint(position); 166 167 } 167 168 else 168 169 printf("object has left terrain\n"); 169 170 170 } 171 171 … … 179 179 for(int i = 0; i < (int)pow(4, this->treeDepth); ++i) 180 180 { 181 //this->nodes[i]->drawTree(0, 0);181 this->nodes[i]->draw(); 182 182 } 183 183 -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r4920 r4921 102 102 this->offset = 0.0f; 103 103 this->nodeIter = -1; 104 this->bDraw = false; 104 105 105 106 this->parent = NULL; … … 366 367 else 367 368 printf("POINT IS NOT INSIEDE\n"); 369 this->bDraw = true; 368 370 } 369 371 … … 379 381 float h = 50.0f; 380 382 383 //printf("draw @ %f, %f to %f, %f", t1.x + ax, t1.z + ax, t1.x - ax, t1.z - ax); 384 385 this->quadtree->getMaterial(this->indexNode)->select(); 381 386 glBegin(GL_QUADS); 382 this->quadtree->getMaterial(this->indexNode)->select();383 387 glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z + ax); 384 388 glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z + ax); … … 398 402 this->nodeD->drawTree(depth - 1, drawMode); 399 403 } 404 405 void QuadtreeNode::draw() const 406 { 407 if( likely(!bDraw)) 408 return; 409 Vector t1 = *this->pDimension->getCenter(); 410 float ax = this->pDimension->getAxis(); 411 float h = 70.0f; 412 413 //printf("draw @ %f, %f to %f, %f", t1.x + ax, t1.z + ax, t1.x - ax, t1.z - ax); 414 415 glBegin(GL_QUADS); 416 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 // } 425 glEnd(); 426 427 } -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r4920 r4921 35 35 36 36 void drawTree(int depth, int drawMode) const; 37 void draw() const; 37 38 38 39 … … 71 72 modelInfo* pModelInfo; //!< reference to the modelInfo of the object 72 73 Rectangle* pDimension; //!< pointer to the local rectangle properties 74 75 bool bDraw; //!< shall it be drawn? DEBUG only 73 76 }; 74 77 -
orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc
r4914 r4921 99 99 Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model) 100 100 { 101 this->quadtree = new Quadtree(model->getModelInfo(), 4);101 this->quadtree = new Quadtree(model->getModelInfo(), 5); 102 102 103 103 return this->quadtree;
Note: See TracChangeset
for help on using the changeset viewer.