Changeset 6911 in orxonox.OLD for branches/current_cd/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jan 31, 2006, 7:12:41 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/current_cd/src/lib/collision_detection/obb_tree_node.cc
r6909 r6911 515 515 516 516 517 void OBBTreeNode::collideWith(const BVTreeNode& treeNode, const WorldEntity& nodeA, const WorldEntity& nodeB) const517 void OBBTreeNode::collideWith(const BVTreeNode& treeNode, WorldEntity* nodeA, WorldEntity* nodeB) 518 518 { 519 519 PRINTF(3)("collideWith\n"); … … 525 525 if( this->overlapTest(*this->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB)) 526 526 { 527 PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA .getClassName(), nodeB.getClassName(), this->nodeLeft, this->nodeRight);527 PRINTF(3)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight); 528 528 529 529 /* check if left node overlaps */ … … 552 552 if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL)) 553 553 { 554 nodeA .collidesWith(nodeB, (((const OBBTreeNode*)&treeNode)->bvElement->center));555 556 nodeB .collidesWith(nodeA, this->bvElement->center);557 } 558 559 } 560 } 561 562 563 564 bool OBBTreeNode::overlapTest(const OBB& boxA, const OBB& boxB, const WorldEntity& nodeA, const WorldEntity& nodeB) const554 nodeA->collidesWith(nodeB, (((const OBBTreeNode*)&treeNode)->bvElement->center)); 555 556 nodeB->collidesWith(nodeA, this->bvElement->center); 557 } 558 559 } 560 } 561 562 563 564 bool OBBTreeNode::overlapTest(const OBB& boxA, const OBB& boxB, WorldEntity* nodeA, WorldEntity* nodeB) 565 565 { 566 566 // if( boxB == NULL || boxA == NULL) … … 575 575 Vector rotAxisB[3]; 576 576 577 rotAxisA[0] = nodeA .getAbsDir().apply(boxA.axis[0]);578 rotAxisA[1] = nodeA .getAbsDir().apply(boxA.axis[1]);579 rotAxisA[2] = nodeA .getAbsDir().apply(boxA.axis[2]);580 581 rotAxisB[0] = nodeB .getAbsDir().apply(boxB.axis[0]);582 rotAxisB[1] = nodeB .getAbsDir().apply(boxB.axis[1]);583 rotAxisB[2] = nodeB .getAbsDir().apply(boxB.axis[2]);584 585 586 t = nodeA .getAbsCoor() + nodeA.getAbsDir().apply(boxA.center) - ( nodeB.getAbsCoor() + nodeB.getAbsDir().apply(boxB.center));577 rotAxisA[0] = nodeA->getAbsDir().apply(boxA.axis[0]); 578 rotAxisA[1] = nodeA->getAbsDir().apply(boxA.axis[1]); 579 rotAxisA[2] = nodeA->getAbsDir().apply(boxA.axis[2]); 580 581 rotAxisB[0] = nodeB->getAbsDir().apply(boxB.axis[0]); 582 rotAxisB[1] = nodeB->getAbsDir().apply(boxB.axis[1]); 583 rotAxisB[2] = nodeB->getAbsDir().apply(boxB.axis[2]); 584 585 586 t = nodeA->getAbsCoor() + nodeA->getAbsDir().apply(boxA.center) - ( nodeB->getAbsCoor() + nodeB->getAbsDir().apply(boxB.center)); 587 587 588 588 // printf("\n");
Note: See TracChangeset
for help on using the changeset viewer.