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

Function xSweptSphereToStatDyn

src/SB/Core/x/xCollide.cpp:2266–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2264 xVec3Sub(&ray.dir, &sws->end, &sws->start);
2265 ray.max_t = xVec3Length(&ray.dir);
2266
2267 F32 one_len = 1.0f / MAX(ray.max_t, 0.00001f);
2268 xVec3SMul(&ray.dir, &ray.dir, one_len);
2269
2270 ray.flags = XRAY3_USE_MAX;
2271 if (!(ray.flags & XRAY3_USE_MIN))
2272 {
2273 ray.flags |= XRAY3_USE_MIN;
2274 ray.min_t = 0.0f;
2275 }
2276
2277 xRayHitsGrid(&colls_grid, sc, &ray, SweptSphereHitsEntCB, &sws->qcd, sws);
2278 xRayHitsGrid(&colls_oso_grid, sc, &ray, SweptSphereHitsEntCB, &sws->qcd, sws);
2279
2280 return sSweptSphereEntFound;
2281}
2282
2283S32 xSweptSphereToNPC(xSweptSphere* sws, xScene* sc, xEnt* mover, U8 collType)
2284{
2285 if (sws->dist == 0.0f)
2286 return 0;
2287
2288 sSweptSphereEntFound = 0;
2289 sSweptSphereMover = mover;
2290 sSweptSphereCollType = collType;
2291
2292 xRay3 ray;
2293 xVec3Copy(&ray.origin, &sws->start);
2294 xVec3Sub(&ray.dir, &sws->end, &sws->start);
2295 ray.max_t = xVec3Length(&ray.dir);
2296
2297 F32 one_len = 1.0f / MAX(ray.max_t, 0.00001f);

Callers

nothing calls this directly

Calls 5

xVec3CopyFunction · 0.85
xVec3SubFunction · 0.85
xVec3LengthFunction · 0.85
xVec3SMulFunction · 0.85
xRayHitsGridFunction · 0.70

Tested by

no test coverage detected