Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4712 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 26, 2005, 10:56:45 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: more draw options

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/bv_tree.h

    r4700 r4712  
    2626  DRAW_BV_BLENDED        = 1<<4,
    2727  DRAW_BV_POLYGON        = 1<<5,
    28   DRAW_MODEL             = 1<<6
     28  DRAW_MODEL             = 1<<6,
     29  DRAW_POINTS            = 1<<7
    2930};
    3031
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4711 r4712  
    472472  PRINTF(3)("-- Finished Calculating Attributes\n");
    473473
    474 
    475 
    476 //   PRINTF(3)("\nwe got length: \n");
    477   for(int i = 0; i < 3; ++i)
    478   {
    479     //if( box->halfLength[i] == 0.0)
    480     if(fabs(box->halfLength[i]) > 5.0f)
    481     {
    482       PRINTF(0)("length[%i] = %f\n", i, box->halfLength[i]);
    483       PRINTF(0)("MaxLength = %f, MinLength = %f\n", maxLength[i], minLength[i]);
    484       PRINTF(0)("\nVertex Data:\n");
    485       for(int i = 0; i < length; i++)
    486       {
    487         PRINTF(0)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);
    488       }
    489     }
    490   }
    491474}
    492475
     
    626609  /* if the obb overlap, make subtests: check which node is realy overlaping  */
    627610  PRINT(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex());
     611  //if( unlikely())
    628612  if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement, nodeA, nodeB))
    629613  {
     
    780764    if( !(drawMode & DRAW_SINGLE && depth != 0))
    781765    {
     766      if( drawMode & DRAW_POINTS)
     767        glBegin(GL_POINTS);
    782768      for(int i = 0; i < this->bvElement->numOfVertices; ++i)
    783769      {
    784         glPushMatrix();
    785         //glMatrixMode(GL_MODELVIEW);
    786         //glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
    787         glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
    788         gluSphere(this->sphereObj, 0.1, 10, 10);
    789         //PRINTF(0)("v(%f, %f, %f)\n", this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
    790         glPopMatrix();
     770        if( drawMode & DRAW_POINTS)
     771          glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
     772        else
     773        {
     774          glPushMatrix();
     775          glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
     776          gluSphere(this->sphereObj, 0.1, 10, 10);
     777          glPopMatrix();
     778        }
    791779      }
     780      if( drawMode & DRAW_POINTS)
     781        glEnd();
    792782    }
    793783  }
Note: See TracChangeset for help on using the changeset viewer.