Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4889 in orxonox.OLD


Ignore:
Timestamp:
Jul 18, 2005, 10:27:16 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: added the debug draw function to the quadtree

Location:
orxonox/trunk/src
Files:
6 edited

Legend:

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

    r4887 r4889  
    7676 */
    7777void Quadtree::drawTree(int depth, int drawMode) const
    78 {}
     78{
     79  this->rootNode->drawTree(depth, drawMode);
     80}
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r4888 r4889  
    261261  Vector t1 = *this->pDimension->getCenter();
    262262  float ax = this->pDimension->getAxis();
    263   float h = 0.0f;
     263  float h = 50.0f;
    264264
    265265  glBegin(GL_QUADS);
    266   glVertex3f(t1.x + ax, h, t1.z + ax);
    267   glVertex3f(t1.x - ax, h, t1.z + ax);
    268   glVertex3f(t1.x - ax, h, t1.z - ax);
    269   glVertex3f(t1.x + ax, h, t1.z - ax);
     266  glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z + ax);
     267  glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z + ax);
     268  glVertex3f(t1.x - ax, h - depth * 10.0f, t1.z - ax);
     269  glVertex3f(t1.x + ax, h - depth * 10.0f, t1.z - ax);
    270270  glEnd();
     271
     272  if( this->nodeA != NULL)
     273    this->nodeA->drawTree(depth - 1, drawMode);
     274  if( this->nodeB != NULL)
     275    this->nodeB->drawTree(depth - 1, drawMode);
     276  if( this->nodeC != NULL)
     277    this->nodeC->drawTree(depth - 1, drawMode);
     278  if( this->nodeD != NULL)
     279    this->nodeD->drawTree(depth - 1, drawMode);
    271280}
    272281
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r4887 r4889  
    112112
    113113
     114void SpatialSeparation::drawQuadtree()
     115{
     116  if( unlikely( this->quadtree == NULL))
     117    return;
     118
     119  this->quadtree->drawTree(4, 0);
     120}
    114121
    115122
     
    124131
    125132
    126 
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h

    r4845 r4889  
    3434
    3535
     36    void drawQuadtree();
     37
    3638  private:
    3739    void separateZone();
  • orxonox/trunk/src/world_entities/terrain.cc

    r4855 r4889  
    3939  this->loadParams(root);
    4040
    41   SpatialSeparation* ssp = new SpatialSeparation((AbstractModel*)this->model, 10.0f);
    42   delete ssp;
     41  this->ssp = new SpatialSeparation((AbstractModel*)this->model, 10.0f);
     42// //   delete ssp;
    4343}
    4444
     
    8383  if (objectList)
    8484    glDeleteLists(this->objectList, 1);
     85  if( this->ssp)
     86    delete ssp;
    8587}
    8688
  • orxonox/trunk/src/world_entities/terrain.h

    r4836 r4889  
    1515// FORWARD DEFINITION \\
    1616class TiXmlElement;
     17class SpatialSeparation;
    1718
    1819//! A simple method to call a desired debug world.
     
    3839 private:
    3940  int objectList;
     41  SpatialSeparation* ssp;
    4042};
    4143
Note: See TracChangeset for help on using the changeset viewer.