Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 13, 2005, 9:41:30 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the obb tree now gets rendered correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4617 r4618  
    4848{
    4949  this->setClassID(CL_OBB_TREE_NODE, "OBBTreeNode");
    50 
     50  this->nodeLeft = NULL;
     51  this->nodeRight = NULL;
    5152}
    5253
     
    388389
    389390
    390 void OBBTreeNode::drawBV(int currentDepth, const int depth) const
     391void OBBTreeNode::drawBV(int depth) const
    391392{
    392393//   glBegin(GL_LINE_LOOP);
     
    402403
    403404
    404 void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const
     405void OBBTreeNode::drawBVPolygon(int depth) const
    405406{
    406407
     
    408409
    409410  /* draw world axes */
    410   glBegin(GL_LINES);
    411   glColor3f(0.0, 0.4, 0.3);
    412   glVertex3f(0.0, 0.0, 0.0);
    413   glVertex3f(3.0, 0.0, 0.0);
    414 
    415   glVertex3f(0.0, 0.0, 0.0);
    416   glVertex3f(0.0, 3.0, 0.0);
    417 
    418   glVertex3f(0.0, 0.0, 0.0);
    419   glVertex3f(0.0, 0.0, 3.0);
    420   glEnd();
     411//   glBegin(GL_LINES);
     412//   glColor3f(0.0, 0.4, 0.3);
     413//   glVertex3f(0.0, 0.0, 0.0);
     414//   glVertex3f(3.0, 0.0, 0.0);
     415//
     416//   glVertex3f(0.0, 0.0, 0.0);
     417//   glVertex3f(0.0, 3.0, 0.0);
     418//
     419//   glVertex3f(0.0, 0.0, 0.0);
     420//   glVertex3f(0.0, 0.0, 3.0);
     421//   glEnd();
    421422
    422423
    423424
    424425  /* draw the obb axes */
    425   glBegin(GL_LINES);
    426   glColor3f(0.0, 0.4, 0.3);
    427   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
    428   glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0],
    429              this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0],
    430              this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);
    431 
    432   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
    433   glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1],
    434              this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1],
    435              this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]);
    436 
    437   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
    438   glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2],
    439              this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2],
    440              this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);
    441   glEnd();
     426//   glBegin(GL_LINES);
     427//   glColor3f(0.0, 0.4, 0.3);
     428//   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     429//   glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0],
     430//              this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0],
     431//              this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);
     432//
     433//   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     434//   glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1],
     435//              this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1],
     436//              this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]);
     437//
     438//   glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     439//   glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2],
     440//              this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2],
     441//              this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);
     442//   glEnd();
    442443
    443444
     
    519520  glEnd();
    520521
    521 
    522 }
    523 
    524 
    525 void OBBTreeNode::drawBVBlended(int currentDepth, const int depth) const
     522  if( this->nodeLeft != NULL && depth != 0)
     523    this->nodeLeft->drawBVPolygon(depth -1);
     524  if( this->nodeRight != NULL && depth != 0)
     525    this->nodeRight->drawBVPolygon(depth -1);
     526
     527}
     528
     529
     530void OBBTreeNode::drawBVBlended(int depth) const
    526531{}
    527532
Note: See TracChangeset for help on using the changeset viewer.