Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 16, 2005, 8:44:55 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: cd now works all obj-obj collisions are detected and for each is a message displayed in the console. since the small enemy spacefracts follow the player at one point - there are many collisions at the same time…

File:
1 edited

Legend:

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

    r5043 r5044  
    629629  if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement, nodeA, nodeB))
    630630  {
    631     PRINTF(0)("collision @ lvl %i, object %s vs. %s: ", this->depth, nodeA->getClassName(), nodeB->getClassName());
     631    PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight);
    632632
    633633    /* check if left node overlaps */
    634634    if( likely( this->nodeLeft != NULL))
    635635    {
    636       PRINT(0)("l, ");
    637636      PRINT(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
    638637      if( this->overlapTest(this->nodeLeft->bvElement, ((OBBTreeNode*)treeNode)->bvElement, nodeA, nodeB))
     
    645644    if( likely( this->nodeRight != NULL))
    646645    {
    647       PRINT(0)("r, ");
    648646      PRINT(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex());
    649647      if(this->overlapTest(this->nodeRight->bvElement, ((OBBTreeNode*)treeNode)->bvElement, nodeA, nodeB))
     
    652650       this->nodeRight->collideWith(((OBBTreeNode*)treeNode)->nodeRight, nodeA, nodeB);
    653651      }
    654 
    655       PRINT(0)("\n");
    656       /* so there is a collision and this is the last box in the tree (i.e. leaf) */
    657       if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
    658       {
    659         PRINT(0)("COLLISOIN\n");
    660         nodeA->collidesWith(nodeB);
    661         nodeB->collidesWith(nodeA);
    662       }
    663     }
     652    }
     653
     654    /* so there is a collision and this is the last box in the tree (i.e. leaf) */
     655    if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
     656    {
     657      nodeA->collidesWith(nodeB);
     658      nodeB->collidesWith(nodeA);
     659    }
     660
    664661  }
    665662}
Note: See TracChangeset for help on using the changeset viewer.