////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * Leaf-leaf test for two primitive indices. * \param id0 [in] index from first leaf-triangle * \param id1 [in] index from second leaf-triangle */ ////////////////////////////////////////////////////
| 525 | */ |
| 526 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 527 | void AABBTreeCollider::PrimTest(udword id0, udword id1) |
| 528 | { |
| 529 | // Request vertices from the app |
| 530 | VertexPointers VP0; |
| 531 | VertexPointers VP1; |
| 532 | mIMesh0->GetTriangle(VP0, id0); |
| 533 | mIMesh1->GetTriangle(VP1, id1); |
| 534 | |
| 535 | // Transform from space 1 to space 0 |
| 536 | Point u0,u1,u2; |
| 537 | TransformPoint(u0, *VP1.Vertex[0], mR1to0, mT1to0); |
| 538 | TransformPoint(u1, *VP1.Vertex[1], mR1to0, mT1to0); |
| 539 | TransformPoint(u2, *VP1.Vertex[2], mR1to0, mT1to0); |
| 540 | |
| 541 | // Perform triangle-triangle overlap test |
| 542 | if(TriTriOverlap(*VP0.Vertex[0], *VP0.Vertex[1], *VP0.Vertex[2], u0, u1, u2)) |
| 543 | { |
| 544 | // Keep track of colliding pairs |
| 545 | mPairs.Add(id0).Add(id1); |
| 546 | // Set contact status |
| 547 | mFlags |= OPC_CONTACT; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 552 | /** |
nothing calls this directly
no test coverage detected