Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9174 in orxonox.OLD for branches/presentation/src/lib


Ignore:
Timestamp:
Jul 4, 2006, 10:17:57 PM (18 years ago)
Author:
patrick
Message:

work flush

Location:
branches/presentation/src/lib/collision_detection
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/collision_detection/obb_tree.cc

    r9172 r9174  
    9090void OBBTree::createBox(Vector start, Vector end)
    9191{
    92   this->rootNode = new OBBTreeNode(*this, NULL, 11);
     92  this->rootNode = new OBBTreeNode(*this, NULL, 1);
    9393
    9494  this->rootNode->createBox(start, end);
  • branches/presentation/src/lib/collision_detection/obb_tree_node.cc

    r9172 r9174  
    5757  this->nodeRight = NULL;
    5858  this->bvElement = NULL;
     59
     60  this->flag = false;
    5961
    6062  this->triangleIndexList1 = NULL;
     
    99101  this->nodeLeft = NULL;
    100102  this->nodeRight = NULL;
     103//   this->depth = 0;
    101104
    102105  this->bvElement->center = (end - start) * 0.5f;
     
    104107  this->bvElement->halfLength[1] = (end.y - start.y) * 0.5f;
    105108  this->bvElement->halfLength[2] = (end.z - start.z) * 0.5f;
     109
     110  this->bvElement->axis[0] = Vector(1,0,0);
     111  this->bvElement->axis[1] = Vector(0,1,0);
     112  this->bvElement->axis[2] = Vector(0,0,1);
     113
     114
     115  PRINTF(0)("half length %f, %f, %f", this->bvElement->halfLength[0], this->bvElement->halfLength[1], this->bvElement->halfLength[2]);
     116  PRINTF(0)("center:\n");
     117  this->bvElement->center.debug();
     118  this->flag = true;
    106119}
    107120
     
    577590bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
    578591{
     592
    579593  //HACK remove this again
    580594  this->owner = nodeA;
     
    693707void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color,  bool top) const
    694708{
     709
     710  if( !this->flag)
     711    return;
     712
     713  PRINTF(0)("bv box\n");
     714
    695715  /* this function can be used to draw the triangles and/or the points only  */
    696716  if( 1 /*drawMode & DRAW_MODEL || drawMode & DRAW_ALL*/)
  • branches/presentation/src/lib/collision_detection/obb_tree_node.h

    r9172 r9174  
    8080
    8181    WorldEntity*        owner;
     82    bool flag;
    8283};
    8384
Note: See TracChangeset for help on using the changeset viewer.