Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4696 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 25, 2005, 12:22:50 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: started calculating the prjection axis

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r4695 r4696  
    105105void OBBTree::collideWith(BVTree* tree)
    106106{
    107   //this->rootNode->collideWith(tree->);
     107  this->rootNode->collideWith(((OBBTree*)tree)->getRootNode());
    108108}
    109109
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r4695 r4696  
    3434    Material* getTransparentMaterial(unsigned int depth) { return transparentMaterial[depth%5]; }
    3535    int getID() { return ++this->id;}
    36 
     36    inline OBBTreeNode* getRootNode() { return this->rootNode; }
    3737
    3838    void debug();
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4695 r4696  
    606606void OBBTreeNode::collideWith(BVTreeNode* treeNode)
    607607{
     608  PRINTF(0)("collideWith");
    608609  /* if the obb overlap, make subtests: check which node is realy overlaping  */
    609610  if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement))
     
    624625bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB)
    625626{
    626 
    627 }
     627  /* first check all axis */
     628  float r = 0.0f;
     629  Vector l = boxA->axis[0];
     630  for(int i = 0; i < 3; ++i)
     631  {
     632    r += boxA->halfLength[i] * boxA->axis[i].dot(l);
     633  }
     634
     635  printf("r = %f\n", r);
     636  /* now check all orthogonals from the axis */
     637}
     638
    628639
    629640
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4695 r4696  
    204204{
    205205
    206   //CDEngine::getInstance()->checkCollisions();
     206  CDEngine::getInstance()->checkCollisions();
    207207
    208208  currentFrame = SDL_GetTicks();
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4695 r4696  
    131131{
    132132  this->obbTree->collideWith(entity->obbTree);
    133 
    134133}
    135134
Note: See TracChangeset for help on using the changeset viewer.