Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7708 in orxonox.OLD


Ignore:
Timestamp:
May 18, 2006, 8:46:40 PM (18 years ago)
Author:
patrick
Message:

cd: real debug and less output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/lib/collision_detection/obb_tree_node.cc

    r7707 r7708  
    334334    maxLength[k] = p->distancePoint(tmpVec);
    335335    minLength[k] = p->distancePoint(tmpVec);
    336 //     PRINT(0)("axis[%i]: %f %f %f\n", k, box.axis[k].x, box.axis[k].y, box.axis[k].z);
    337336
    338337    for( int j = 0; j < length; ++j) {
     
    490489    return;
    491490
    492   PRINTF(3)("collideWith\n");
     491  PRINTF(4)("collideWith\n");
    493492  /* if the obb overlap, make subtests: check which node is realy overlaping  */
    494   PRINTF(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex());
     493  PRINTF(4)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex());
    495494  //   if( unlikely(treeNode == NULL)) return;
    496495
     
    498497  if( this->overlapTest(*this->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
    499498  {
    500     PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight);
     499    PRINTF(4)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight);
    501500
    502501    /* check if left node overlaps */
    503502    if( likely( this->nodeLeft != NULL))
    504503    {
    505       PRINTF(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
     504      PRINTF(4)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
    506505      if( this->overlapTest(*this->nodeLeft->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
    507506      {
     
    513512    if( likely( this->nodeRight != NULL))
    514513    {
    515       PRINTF(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex());
     514      PRINTF(4)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex());
    516515      if(this->overlapTest(*this->nodeRight->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB))
    517516      {
     
    586585    rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
    587586
    588     PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
     587    PRINTF(5)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
    589588
    590589    if( (rA + rB) < fabs(t.dot(l)))
    591590    {
    592       PRINTF(3)("no Collision\n");
     591      PRINTF(4)("no Collision\n");
    593592      return false;
    594593    }
     
    610609    rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
    611610
    612     PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
     611    PRINTF(5)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
    613612
    614613    if( (rA + rB) < fabs(t.dot(l)))
    615614    {
    616       PRINTF(3)("no Collision\n");
     615      PRINTF(4)("no Collision\n");
    617616      return false;
    618617    }
     
    638637      rB += fabs(boxB.halfLength[2] * rotAxisB[2].dot(l));
    639638
    640       PRINTF(3)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
     639      PRINTF(5)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
    641640
    642641      if( (rA + rB) < fabs(t.dot(l)))
    643642      {
    644         PRINTF(3)("keine Kollision\n");
     643        PRINTF(4)("keine Kollision\n");
    645644        return false;
    646645      }
     
    653652
    654653
    655   PRINTF(3)("Kollision!\n");
     654  PRINTF(4)("Kollision!\n");
    656655  return true;
    657656}
     
    681680        glBegin(GL_POINTS);
    682681        glColor3f(0.3, 0.8, 0.54);
    683         for( int i = 0; i < this->bvElement->modelInf->numTriangles; ++i)
    684         {
    685           for(int j = 0; j < 3; ++j)
    686           {
    687             glVertex3f(
    688                 (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[0],
    689                 (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[1],
    690                 (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[2]);
    691           }
    692         }
    693 
    694 //         for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
    695 //           glVertex3f(this->bvElement->modelInf->pVertices[i],
    696 //                      this->bvElement->modelInf->pVertices[i+1],
    697 //                      this->bvElement->modelInf->pVertices[i+2]);
     682        for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
     683          glVertex3f(this->bvElement->modelInf->pVertices[i],
     684                     this->bvElement->modelInf->pVertices[i+1],
     685                     this->bvElement->modelInf->pVertices[i+2]);
    698686        glEnd();
    699687      }
Note: See TracChangeset for help on using the changeset viewer.