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

Function NPCC_LineHitsBound

src/SB/Game/zNPCSupport.cpp:957–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957U32 NPCC_LineHitsBound(xVec3* param_1, xVec3* param_2, xBound* param_3, xCollis* param_4)
958{
959 xRay3 ray;
960 xVec3 vec;
961 xCollis local_colrec;
962 xCollis* colrec = &local_colrec;
963 F32 len;
964
965 if (param_4 != NULL)
966 {
967 colrec = (xCollis*)param_4;
968 }
969 xVec3Sub(&vec, param_2, param_1);
970 len = xVec3Length(&vec);
971 if (len < 0.001f)
972 {
973 len = 0.001f;
974 }
975 xVec3Copy(&ray.origin, param_1);
976 xVec3SMul(&ray.dir, &vec, (1.0f / len));
977
978 ray.max_t = len;
979 ray.min_t = 0.1f;
980 ray.flags = 3072;
981
982 xRayHitsBound(&ray, param_3, colrec);
983 return colrec->flags & 1;
984}
985
986S32 NPCC_bnd_ofBase(xBase* tgt, xBound* bnd)
987{

Callers

nothing calls this directly

Calls 5

xVec3SubFunction · 0.85
xVec3LengthFunction · 0.85
xVec3CopyFunction · 0.85
xVec3SMulFunction · 0.85
xRayHitsBoundFunction · 0.50

Tested by

no test coverage detected