| 559 | } |
| 560 | |
| 561 | void iBoxIsectSphere(const xBox* box, const xSphere* p, xIsect* isx) |
| 562 | { |
| 563 | U32 xcode, ycode, zcode; |
| 564 | |
| 565 | // non-matching: (p->center.x + p->r) computed inside if statement |
| 566 | |
| 567 | if (p->center.x - p->r < box->lower.x) |
| 568 | { |
| 569 | if (p->center.x + p->r < box->lower.x) |
| 570 | { |
| 571 | xcode = 2; |
| 572 | } |
| 573 | else if (p->center.x + p->r > box->upper.x) |
| 574 | { |
| 575 | xcode = 0; |
| 576 | } |
| 577 | else |
| 578 | { |
| 579 | xcode = 1; |
| 580 | } |
| 581 | } |
| 582 | else |
| 583 | { |
| 584 | if (p->center.x - p->r > box->upper.x) |
| 585 | { |
| 586 | xcode = 5; |
| 587 | } |
| 588 | else if (p->center.x + p->r > box->upper.x) |
| 589 | { |
| 590 | xcode = 4; |
| 591 | } |
| 592 | else |
| 593 | { |
| 594 | xcode = 3; |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | // non-matching: missing division instructions |
| 599 | |
| 600 | if (xcode / 3 == 2) |
| 601 | { |
| 602 | isx->penned = 1.0f; |
| 603 | return; |
| 604 | } |
| 605 | |
| 606 | // non-matching: (p->center.y + p->r) computed inside if statement |
| 607 | |
| 608 | if (p->center.y - p->r < box->lower.y) |
| 609 | { |
| 610 | if (p->center.y + p->r < box->lower.y) |
| 611 | { |
| 612 | ycode = 2; |
| 613 | } |
| 614 | else if (p->center.y + p->r > box->upper.y) |
| 615 | { |
| 616 | ycode = 0; |
| 617 | } |
| 618 | else |
no test coverage detected