Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 3, 2006, 9:34:57 AM (18 years ago)
Author:
patrick
Message:

cd: work flush

File:
1 edited

Legend:

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

    r6922 r7005  
    6666  if( OBBTreeNode_sphereObj == NULL)
    6767    OBBTreeNode_sphereObj = gluNewQuadric();
     68
     69  this->owner = NULL;
    6870
    6971  /* debug ids */
     
    565567
    566568
    567 bool OBBTreeNode::overlapTest(const OBB& boxA, const OBB& boxB, WorldEntity* nodeA, WorldEntity* nodeB)
    568 {
     569bool OBBTreeNode::overlapTest(OBB& boxA, OBB& boxB, WorldEntity* nodeA, WorldEntity* nodeB)
     570{
     571  //HACK remove this again
     572  this->owner = nodeA;
    569573  //   if( boxB == NULL || boxA == NULL)
    570574  //     return false;
     
    677681
    678682  /* FIXME: there is no collision mark set now */
    679   //   boxA.bCollided = true; /* use this ONLY(!!!!) for drawing operations */
    680   //   boxB.bCollided = true;
     683     boxA.bCollided = true; /* use this ONLY(!!!!) for drawing operations */
     684     boxB.bCollided = true;
    681685
    682686
     
    689693
    690694
     695
     696
     697
     698
     699
     700/**
     701 *
     702 * draw the BV tree - debug mode
     703 */
    691704void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color,  bool top) const
    692705{
    693 
    694 
    695706  /* this function can be used to draw the triangles and/or the points only  */
    696707  if( drawMode & DRAW_MODEL || drawMode & DRAW_ALL)
     
    778789      depth = 0;
    779790
    780     if( !(drawMode & DRAW_SINGLE && depth != 0))
    781     {
    782       PRINTF(0)("debug poly draw: depth: %i, mode: %i\n", depth, drawMode);
     791    if( depth == 0 /*!(drawMode & DRAW_SINGLE && depth != 0)*/)
     792    {
     793
    783794
    784795      Vector cen = this->bvElement->center;
     
    794805        glColor4f(color.x, color.y, color.z, .5);
    795806      }
     807
     808      // debug out
     809      if( this->obbTree->getOwner() != NULL)
     810      {
     811        PRINTF(0)("debug poly draw: depth: %i, mode: %i, entity-name: %s, class: %s\n", depth, drawMode, this->obbTree->getOwner()->getName(), this->obbTree->getOwner()->getClassName());
     812      }
     813      else
     814        PRINTF(0)("debug poly draw: depth: %i, mode: %i\n", depth, drawMode);
     815
    796816
    797817      /* draw bounding box */
     
    902922      }
    903923
    904 
    905924      if( drawMode & DRAW_BV_BLENDED)
    906925        glColor3f(color.x, color.y, color.z);
    907926    }
    908 
    909927  }
    910928
Note: See TracChangeset for help on using the changeset viewer.