Changeset 9008 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Jul 2, 2006, 2:22:19 PM (18 years ago)
- Location:
- trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/bounding_volume.h
r7711 r9008 38 38 const int* triangleIndexes; //!< Array with the triangle indexes in modelInfo 39 39 int triangleIndexesLength; //!< length of the indexes array 40 41 float radius; //!< the radius of the box (longest axis) 40 42 }; 41 43 -
trunk/src/lib/collision_detection/obb_tree_node.cc
r8776 r9008 364 364 } 365 365 } 366 this->bvElement->radius = longestAxis; 366 367 PRINTF(4)("\nLongest Axis is: Nr %i with a half-length of:%11.2f\n", longestAxisIndex, longestAxis); 367 368 … … 454 455 return; 455 456 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 456 465 PRINTF(4)("collideWith\n"); 457 466 PRINTF(5)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex()); … … 482 491 if( this->overlapTest(this->nodeLeft->bvElement, treeNode->bvElement, nodeA, nodeB)) 483 492 { 493 bool bAdvance = false; 484 494 if( treeNode->nodeLeft != NULL) 485 495 this->nodeLeft->collideWith(treeNode->nodeLeft, nodeA, nodeB); 496 else 497 bAdvance = true; 498 486 499 if( treeNode->nodeRight != NULL) 487 500 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 488 506 } 489 507 } … … 494 512 if( this->overlapTest(this->nodeRight->bvElement, treeNode->bvElement, nodeA, nodeB)) 495 513 { 514 bool bAdvance = false; 515 496 516 if( treeNode->nodeLeft != NULL) 497 517 this->nodeRight->collideWith(treeNode->nodeLeft, nodeA, nodeB); 518 else 519 bAdvance = true; 520 498 521 if( treeNode->nodeRight != NULL) 499 522 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 500 528 } 501 529 } … … 516 544 (treeNode->nodeRight == NULL && treeNode->nodeLeft == NULL)) ) 517 545 { 546 // PRINTF(0)("----------------------------------------------\n\n\n\n\n\n--------------------------------\n\n\n"); 518 547 nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement); 519 548 }
Note: See TracChangeset
for help on using the changeset viewer.