| 2294 | } |
| 2295 | |
| 2296 | S32 xSweptSphereToNPC(xSweptSphere* sws, xScene* sc, xEnt* mover, U8 collType) |
| 2297 | { |
| 2298 | if (sws->dist == 0.0f) |
| 2299 | return 0; |
| 2300 | |
| 2301 | sSweptSphereEntFound = 0; |
| 2302 | sSweptSphereMover = mover; |
| 2303 | sSweptSphereCollType = collType; |
| 2304 | |
| 2305 | xRay3 ray; |
| 2306 | xVec3Copy(&ray.origin, &sws->start); |
| 2307 | xVec3Sub(&ray.dir, &sws->end, &sws->start); |
| 2308 | ray.max_t = xVec3Length(&ray.dir); |
| 2309 | |
| 2310 | F32 one_len = 1.0f / MAX(ray.max_t, 0.00001f); |
| 2311 | xVec3SMul(&ray.dir, &ray.dir, one_len); |
| 2312 | |
| 2313 | ray.flags = XRAY3_USE_MAX; |
| 2314 | if (!(ray.flags & XRAY3_USE_MIN)) |
| 2315 | { |
| 2316 | ray.flags |= XRAY3_USE_MIN; |
| 2317 | ray.min_t = 0.0f; |
| 2318 | } |
| 2319 | |
| 2320 | xRayHitsGrid(&npcs_grid, sc, &ray, SweptSphereHitsEntCB, &sws->qcd, sws); |
| 2321 | |
| 2322 | return sSweptSphereEntFound; |
| 2323 | } |
| 2324 | |
| 2325 | S32 xSweptSphereToNonMoving(xSweptSphere* sws, xScene* sc, xEnt* mover, U8 collType) |
| 2326 | { |
nothing calls this directly
no test coverage detected