Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7735 in orxonox.OLD for trunk/src/lib/collision_detection


Ignore:
Timestamp:
May 19, 2006, 5:36:25 PM (19 years ago)
Author:
patrick
Message:

trunk: the new collision detection seems to be much more accurate than the old. There is still a little issue with the detection

File:
1 edited

Legend:

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

    r7734 r7735  
    282282  box.axis[2] = axis[2];
    283283
     284  // this is for axis aligned bouning boxes only
    284285//   box.axis[0] = Vector(1,0,0);
    285286//   box.axis[1] = Vector(0,1,0);
     
    489490{
    490491  if( unlikely(treeNode == NULL || nodeA == NULL || nodeB == NULL))
    491   {
    492 //     assert(false);
    493492    return;
    494   }
     493
    495494
    496495  PRINTF(4)("collideWith\n");
     
    517516
    518517    /* check if left node overlaps */
    519     if( likely( this->nodeLeft != NULL))
     518    if( this->nodeLeft != NULL )
    520519    {
    521520      PRINTF(5)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
     
    538537
    539538    /* so there is a collision and this is the last box in the tree (i.e. leaf) */
    540     /* FIXME: If we would choose || insead of && there would also be asymmetrical cases supported */
    541     if( unlikely(this->nodeRight == NULL || this->nodeLeft == NULL))
     539    if( unlikely((this->nodeRight == NULL || this->nodeLeft == NULL) ||
     540                 (treeNode->nodeRight == NULL || treeNode->nodeLeft == NULL)) )
    542541    {
    543542      nodeA->collidesWith(nodeB, treeNode->bvElement->center);
Note: See TracChangeset for help on using the changeset viewer.