| 657 | } |
| 658 | |
| 659 | void xRayHitsSceneFlags(xScene* sc, xRay3* r, xCollis* coll, U8 collType, U8 chk) |
| 660 | { |
| 661 | coll->dist = HUGE; |
| 662 | coll->flags = (coll->flags & ~k_HIT_IT) | k_HIT_0x100; |
| 663 | |
| 664 | cb_ray_hits_ent cb(*r, *coll, collType, chk); |
| 665 | |
| 666 | xBound bound; |
| 667 | bound.type = XBOUND_TYPE_BOX; |
| 668 | xBoxFromRay(bound.box.box, *r); |
| 669 | xVec3Add(&bound.box.center, &bound.box.box.lower, &bound.box.box.upper); |
| 670 | xVec3SMul(&bound.box.center, &bound.box.center, 0.5f); |
| 671 | |
| 672 | xQuickCullForRay(&bound.qcd, r); |
| 673 | |
| 674 | if (chk & (XENT_COLLTYPE_STAT | XENT_COLLTYPE_DYN)) |
| 675 | { |
| 676 | xGridCheckBound(colls_grid, bound, bound.qcd, cb); |
| 677 | xGridCheckBound(colls_oso_grid, bound, bound.qcd, cb); |
| 678 | } |
| 679 | |
| 680 | if (chk & XENT_COLLTYPE_NPC) |
| 681 | { |
| 682 | xGridCheckBound(npcs_grid, bound, bound.qcd, cb); |
| 683 | } |
| 684 | |
| 685 | if (chk & 0x20) |
| 686 | { |
| 687 | xCollis temp_coll; |
| 688 | temp_coll.flags = coll->flags; |
| 689 | temp_coll.dist = HUGE; |
| 690 | |
| 691 | iRayHitsEnv(r, sc->env, &temp_coll); |
| 692 | |
| 693 | if (temp_coll.dist < coll->dist) |
| 694 | { |
| 695 | memcpy(coll, &temp_coll, sizeof(xCollis)); |
| 696 | coll->optr = NULL; |
| 697 | coll->mptr = NULL; |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | void ProjectTriangle(xVec3* param_1, xVec3* param_2, float* param_3, float* param_4) |
| 703 | { |
no test coverage detected