Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8849 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 1:49:00 PM (18 years ago)
Author:
patrick
Message:

collision detection works now

Location:
branches/multi_player_map/src
Files:
2 edited

Legend:

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

    r8845 r8849  
    489489      if( this->overlapTest(this->nodeLeft->bvElement, treeNode->bvElement, nodeA, nodeB))
    490490      {
     491        bool bAdvance = false;
    491492        if( treeNode->nodeLeft != NULL)
    492493          this->nodeLeft->collideWith(treeNode->nodeLeft, nodeA, nodeB);
     494        else
     495          bAdvance = true;
     496
    493497        if( treeNode->nodeRight != NULL)
    494498          this->nodeLeft->collideWith(treeNode->nodeRight, nodeA, nodeB);
     499        else
     500          bAdvance = true;
     501
     502        if( bAdvance)
     503          this->nodeLeft->collideWith(treeNode, nodeA, nodeB);  // go down the other tree also
    495504      }
    496505    }
     
    501510      if( this->overlapTest(this->nodeRight->bvElement, treeNode->bvElement, nodeA, nodeB))
    502511      {
     512        bool bAdvance = false;
     513
    503514        if( treeNode->nodeLeft != NULL)
    504515          this->nodeRight->collideWith(treeNode->nodeLeft, nodeA, nodeB);
     516        else
     517          bAdvance = true;
     518
    505519        if( treeNode->nodeRight != NULL)
    506520          this->nodeRight->collideWith(treeNode->nodeRight, nodeA, nodeB);
     521        else
     522          bAdvance = true;
     523
     524        if( bAdvance)
     525          this->nodeRight->collideWith(treeNode, nodeA, nodeB);  // go down the other tree also
    507526      }
    508527    }
     
    523542        (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) )
    524543    {
    525       PRINTF(0)("----------------------------------------------\\n\n\n\n\n\n--------------------------------\n\n\n");
     544//       PRINTF(0)("----------------------------------------------\n\n\n\n\n\n--------------------------------\n\n\n");
    526545      nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    527546    }
  • branches/multi_player_map/src/story_entities/multi_player_world.cc

    r8845 r8849  
    9696
    9797  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
    98   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    99     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     98  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ),
     99  this->dataTank->objectManager->getObjectList(OM_PLAYERS));
    100100  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    101101  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
     
    108108  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    109109    this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    110 
    111110
    112111
Note: See TracChangeset for help on using the changeset viewer.