Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 2, 2006, 2:22:19 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the network bak to the trunk
merged with command:
svn merge -r8804:HEAD https://svn.orxonox.net/orxonox/branches/multi_player_map .

conflicts all resolved in favour of the branche

Location:
trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/bounding_volume.h

    r7711 r9008  
    3838    const int*          triangleIndexes;            //!< Array with the triangle indexes in modelInfo
    3939    int                 triangleIndexesLength;      //!< length of the indexes array
     40
     41    float               radius;                     //!< the radius of the box (longest axis)
    4042};
    4143
  • trunk/src/lib/collision_detection/obb_tree_node.cc

    r8776 r9008  
    364364    }
    365365  }
     366  this->bvElement->radius = longestAxis;
    366367  PRINTF(4)("\nLongest Axis is: Nr %i with a half-length of:%11.2f\n", longestAxisIndex, longestAxis);
    367368
     
    454455    return;
    455456
     457  float distanceMax = this->bvElement->radius + ((OBBTreeNode*)treeNode)->bvElement->radius;
     458  float distance = fabs((nodeA->getAbsCoor() - nodeB->getAbsCoor()).len());
     459
     460
     461//   if( distance < distanceMax)
     462//     PRINTF(0)(" %s (%s: group %i) vs %s (%s: group %i): distanceMax: %f, distance: %f\n", nodeA->getClassName(), nodeA->getName(), nodeA->getOMListNumber(), nodeB->getClassName(),  nodeB->getName(), nodeB->getOMListNumber(), distanceMax, distance);
     463
     464
    456465  PRINTF(4)("collideWith\n");
    457466  PRINTF(5)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex());
     
    482491      if( this->overlapTest(this->nodeLeft->bvElement, treeNode->bvElement, nodeA, nodeB))
    483492      {
     493        bool bAdvance = false;
    484494        if( treeNode->nodeLeft != NULL)
    485495          this->nodeLeft->collideWith(treeNode->nodeLeft, nodeA, nodeB);
     496        else
     497          bAdvance = true;
     498
    486499        if( treeNode->nodeRight != NULL)
    487500          this->nodeLeft->collideWith(treeNode->nodeRight, nodeA, nodeB);
     501        else
     502          bAdvance = true;
     503
     504        if( bAdvance)
     505          this->nodeLeft->collideWith(treeNode, nodeA, nodeB);  // go down the other tree also
    488506      }
    489507    }
     
    494512      if( this->overlapTest(this->nodeRight->bvElement, treeNode->bvElement, nodeA, nodeB))
    495513      {
     514        bool bAdvance = false;
     515
    496516        if( treeNode->nodeLeft != NULL)
    497517          this->nodeRight->collideWith(treeNode->nodeLeft, nodeA, nodeB);
     518        else
     519          bAdvance = true;
     520
    498521        if( treeNode->nodeRight != NULL)
    499522          this->nodeRight->collideWith(treeNode->nodeRight, nodeA, nodeB);
     523        else
     524          bAdvance = true;
     525
     526        if( bAdvance)
     527          this->nodeRight->collideWith(treeNode, nodeA, nodeB);  // go down the other tree also
    500528      }
    501529    }
     
    516544        (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) )
    517545    {
     546//       PRINTF(0)("----------------------------------------------\n\n\n\n\n\n--------------------------------\n\n\n");
    518547      nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    519548    }
Note: See TracChangeset for help on using the changeset viewer.