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

Function xRayHitsSceneFlags

src/SB/Core/x/xScene.cpp:659–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659void 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
702void ProjectTriangle(xVec3* param_1, xVec3* param_2, float* param_3, float* param_4)
703{

Callers 3

collide_downwardFunction · 0.70
pre_collideMethod · 0.70
collide_updateMethod · 0.70

Calls 7

xBoxFromRayFunction · 0.85
xVec3AddFunction · 0.85
xVec3SMulFunction · 0.85
memcpyFunction · 0.85
xQuickCullForRayFunction · 0.70
xGridCheckBoundFunction · 0.70
iRayHitsEnvFunction · 0.50

Tested by

no test coverage detected