MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / iSphereHitsEnv4

Function iSphereHitsEnv4

src/SB/Core/gc/iCollide.cpp:690–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690S32 iSphereHitsEnv4(const xSphere* b, const xEnv* env, const xMat3x3* mat, xCollis* colls)
691{
692 RpIntersection isx; // r29+0x50
693 isx.type = rpINTERSECTSPHERE;
694 memcpy(&isx.t.sphere, b, sizeof(xSphere));
695
696 cbmat = mat;
697
698 xCollis* c = colls;
699 xCollis* cend = colls + 6;
700
701 if (env->geom->jsp != NULL)
702 {
703 sCollidingJSP = 1;
704 xClumpColl_ForAllIntersections(env->geom->jsp->colltree, &isx, sphereHitsEnv4CB, colls);
705 sCollidingJSP = 0;
706 }
707 else
708 {
709 RpCollisionWorldForAllIntersections(env->geom->world, &isx, sphereHitsEnv4CB, colls);
710 }
711
712 for (c = colls; c < cend; c++)
713 {
714 if (c->flags & 1)
715 {
716 c->oid += 0x10000;
717 }
718 }
719
720 if (env->geom->collision != NULL)
721 {
722 RpCollisionWorldForAllIntersections(env->geom->collision, &isx, sphereHitsEnv4CB, colls);
723
724 for (c = colls; c < cend; c++)
725 {
726 if (c->flags & 1)
727 {
728 if (c->oid < 0x10000)
729 {
730 c->oid += 0x10000;
731 }
732 else
733 {
734 c->oid -= 0x10000;
735 }
736 }
737 }
738 }
739
740 S32 numcs = 0;
741 for (c = colls; c < cend; c++)
742 {
743 if ((c->flags & 1) == 0)
744 {
745 continue;
746 }
747

Callers

nothing calls this directly

Calls 2

memcpyFunction · 0.85

Tested by

no test coverage detected