Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 21, 2005, 3:32:54 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the way, where the fighter flights though is now drawn in quadtree partitions. now you can see where the space craft has been :)

File:
1 edited

Legend:

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

    r4920 r4921  
    102102  this->offset = 0.0f;
    103103  this->nodeIter = -1;
     104  this->bDraw = false;
    104105
    105106  this->parent = NULL;
     
    366367  else
    367368    printf("POINT IS NOT INSIEDE\n");
     369  this->bDraw = true;
    368370}
    369371
     
    379381    float h = 50.0f;
    380382
     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();
    381386    glBegin(GL_QUADS);
    382     this->quadtree->getMaterial(this->indexNode)->select();
    383387    glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z + ax);
    384388    glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z + ax);
     
    398402    this->nodeD->drawTree(depth - 1, drawMode);
    399403}
     404
     405void 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}
Note: See TracChangeset for help on using the changeset viewer.