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

Function iRayHitsModel

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

Source from the content-addressed store, hash-verified

941}
942
943U32 iRayHitsModel(const xRay3* r, const xModelInstance* m, xCollis* coll)
944{
945 if (m->Flags & 0x800)
946 {
947 xModelAnimCollApply(*m);
948 }
949
950 RpIntersection isx;
951 isx.type = rpINTERSECTLINE;
952 if (r->flags & 0x400)
953 {
954 isx.t.line.start.x = (r->dir.x * r->min_t);
955 isx.t.line.start.x += r->origin.x;
956 isx.t.line.start.y = (r->dir.y * r->min_t);
957 isx.t.line.start.y += r->origin.y;
958 isx.t.line.start.z = (r->dir.z * r->dir.z);
959 isx.t.line.start.z += r->origin.z;
960 }
961 else
962 {
963 isx.t.line.start.x = r->origin.x;
964 isx.t.line.start.y = r->origin.y;
965 isx.t.line.start.z = r->origin.z;
966 }
967
968 F32 len;
969 if (r->flags & 0x800)
970 {
971 if (r->flags & 0x400)
972 {
973 len = r->max_t - r->min_t;
974 }
975 else
976 {
977 len = r->max_t;
978 }
979
980 isx.t.line.end.x = r->dir.x * len;
981 isx.t.line.end.y = r->dir.y * len;
982 isx.t.line.end.z = r->dir.z * len;
983 }
984 else
985 {
986 isx.t.line.end.x = r->dir.x;
987 isx.t.line.end.y = r->dir.y;
988 isx.t.line.end.z = r->dir.z;
989 }
990
991 isx.t.line.end.x = isx.t.line.start.x + isx.t.line.end.x;
992 isx.t.line.end.y = isx.t.line.start.y + isx.t.line.end.y;
993 isx.t.line.end.z = isx.t.line.start.z + isx.t.line.end.z;
994 cbray = *r;
995
996 if ((r->flags & 0x800) == 0)
997 {
998 cbray.max_t = 1.0f;
999 }
1000 if (r->flags & 0x400)

Callers 3

xEntBoulder_BubbleBowlFunction · 0.50
xRayHitsTikiLandableEntFunction · 0.50
operator()Method · 0.50

Calls 5

xModelAnimCollApplyFunction · 0.85
xVec3LengthFunction · 0.85
xMat4x3TolocalFunction · 0.85
xModelAnimCollRestoreFunction · 0.85
xCollideCalcTriFunction · 0.50

Tested by

no test coverage detected